Fixed fix for #6056

This commit is contained in:
PKEuS 2014-08-18 20:40:43 +02:00
parent 49bafa10a0
commit eac2d58c9e
2 changed files with 4 additions and 2 deletions

View File

@ -2590,7 +2590,7 @@ void Tokenizer::setVarId()
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; tok3 = tok3->nextArgument()) {
if (tok3->strAt(-1) == "&" || tok3->strAt(-1) == "*" || (notstart.find(tok3->str()) == notstart.end() && setVarIdParseDeclaration(&tok3, variableId, executableScope.top(), isCPP()))) {
if (tok3->strAt(-2) == "&" || tok3->strAt(-2) == "*" || (notstart.find(tok3->str()) == notstart.end() && setVarIdParseDeclaration(&tok3, variableId, executableScope.top(), isCPP()))) {
isDecl = false;
break;
}

View File

@ -4639,6 +4639,7 @@ private:
" int method_with_internal(int&);\n"
" int method_with_internal(A* b, X&);\n"
" int method_with_internal(X&, A* b);\n"
" int method_with_internal(const B &, int);\n"
"};";
ASSERT_EQUALS("\n\n##file 0\n"
"1: class Fred {\n"
@ -4647,7 +4648,8 @@ private:
"4: int method_with_internal ( int & ) ;\n"
"5: int method_with_internal ( A * b@1 , X & ) ;\n"
"6: int method_with_internal ( X & , A * b@2 ) ;\n"
"7: } ;\n", tokenizeDebugListing(code, false, "test.cpp"));
"7: int method_with_internal ( const B & , int ) ;\n"
"8: } ;\n", tokenizeDebugListing(code, false, "test.cpp"));
}
void varid_initList() {