diff --git a/lib/checkbool.cpp b/lib/checkbool.cpp index 83701d46c..bd1c6f8ba 100644 --- a/lib/checkbool.cpp +++ b/lib/checkbool.cpp @@ -341,7 +341,7 @@ void CheckBool::checkAssignBoolToPointer() for (const Token* tok = scope->classStart; tok != scope->classEnd; tok = tok->next()) { if (tok->str() == "=" && astIsBool(tok->astOperand2())) { const Token *lhs = tok->astOperand1(); - while (lhs && lhs->str() == ".") + while (lhs && (lhs->str() == "." || lhs->str() == "::")) lhs = lhs->astOperand2(); if (!lhs || !lhs->variable() || !lhs->variable()->isPointer()) continue; diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index cf70d5937..d7e0cec40 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -239,7 +239,7 @@ static bool isVariableChanged(const Token *start, const Token *end, const unsign return true; const Token *parent = tok->astParent(); - while (parent && parent->str() == ".") + while (parent && (parent->str() == "." || parent->str() == "::")) parent = parent->astParent(); if (parent && parent->type() == Token::eIncDecOp) return true;