From 6071a5afc33dbe7a27fb1de8258205cac1e7fcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 21 Apr 2012 13:39:43 +0200 Subject: [PATCH] Tokenizer::setVarIdNew: Fixed varidclass9 --- lib/tokenize.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 6bbf22fcf..e037f0329 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2854,8 +2854,13 @@ static void setVarIdClassDeclaration(Token * const startToken, const std::maplink(); // replace varids.. - for (Token *tok = startToken; tok != endToken; tok = tok->next()) { - if (tok->isName() && tok->varId() <= scopeStartVarId) { + unsigned int indentlevel = 0; + for (Token *tok = startToken->next(); tok != endToken; tok = tok->next()) { + if (tok->str() == "{") + ++indentlevel; + else if (tok->str() == "}") + --indentlevel; + else if (indentlevel > 0 && tok->isName() && tok->varId() <= scopeStartVarId) { if (tok->previous()->str() == "::" || tok->next()->str() == "::") continue; const std::map::const_iterator it = variableId.find(tok->str()); @@ -2945,7 +2950,7 @@ void Tokenizer::setVarIdNew() else if (decl && Token::Match(tok2->previous(), "%type% ( !!)")) { const Token *tok3 = tok2->next(); - if (!setVarIdParseDeclaration(&tok3,variableId,executableScope.top())) { + if (!tok3->isStandardType() && !setVarIdParseDeclaration(&tok3,variableId,executableScope.top())) { variableId[tok2->previous()->str()] = ++_varId; tok = tok2->previous(); }