diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d98c653a1..4f261e1a7 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2589,9 +2589,11 @@ void Tokenizer::setVarId() const Token *tok3 = tok2->next(); if (!tok3->isStandardType() && tok3->str() != "void" && !Token::Match(tok3, "struct|union|class %type%") && tok3->str() != "." && !Token::Match(tok2->link()->previous(), "[&*]")) { bool isDecl = true; - for (; tok3 && isDecl; tok3 = tok3->nextArgument()) { - if (tok3->strAt(-1) == "&" || tok3->strAt(-1) == "*" || (notstart.find(tok3->str()) == notstart.end() && setVarIdParseDeclaration(&tok3, variableId, executableScope.top(), isCPP()))) + for (; tok3; tok3 = tok3->nextArgument()) { + if (tok3->strAt(-1) == "&" || tok3->strAt(-1) == "*" || (notstart.find(tok3->str()) == notstart.end() && setVarIdParseDeclaration(&tok3, variableId, executableScope.top(), isCPP()))) { isDecl = false; + break; + } } if (isDecl) { variableId[tok2->previous()->str()] = ++_varId;