diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 09aa30144..8b4dab269 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2300,9 +2300,6 @@ void Tokenizer::simplifyTemplates() static bool setVarIdParseDeclaration(const Token **tok, const std::map &variableId, bool executableScope, bool cpp, bool c) { const Token *tok2 = *tok; - - bool ref = false; - if (!tok2->isName()) return false; @@ -2310,6 +2307,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::mapisName()) { if (cpp && Token::Match(tok2, "namespace|public|private|protected")) @@ -2363,7 +2361,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::map= 2 && tok2 && tok2->str() == "[" && executableScope) { + if (typeCount >= 2 && executableScope && tok2 && tok2->str() == "[") { const Token *tok3 = tok2; while (tok3 && tok3->str() == "[") { tok3 = tok3->link()->next();