From 6f6f9f7754cdea0e0dd156c4c36b19ab10d1f4ea Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 6 Feb 2015 16:30:39 +0300 Subject: [PATCH] Reorder checks, move declaration --- lib/tokenize.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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();