fixed #2614 (missing varid on function parameter)

This commit is contained in:
Robert Reif 2011-04-23 09:37:50 -04:00
parent 6750c7b492
commit cd64d8476c
3 changed files with 4 additions and 9 deletions

View File

@ -3413,7 +3413,8 @@ void Tokenizer::setVarId()
continue;
if (tok->strAt(-1) == "return")
continue;
if (!Token::Match(tok->tokAt(5), "const|{"))
if (tok->link() && !Token::Match(tok->link()->tokAt(1), "const| {") &&
!Token::Match(tok->link()->tokAt(1), ":"))
continue;
}

View File

@ -219,7 +219,7 @@ private:
" EventPtr event = *eventP;\n"
" *actionsP = &event->actions;\n"
"}\n");
TODO_ASSERT_EQUALS("", "[test.cpp:1]: (debug) Function::addArguments found argument 'eventP' with varid 0.\n", errout.str());
ASSERT_EQUALS("", errout.str());
}
void returnLocalVariable1()

View File

@ -2865,13 +2865,7 @@ private:
"3: EventPtr event@3 ; event@3 = * eventP@1 ;\n"
"4: * actionsP@2 = & event@3 . actions@4 ;\n"
"5: }\n");
const std::string actual1("\n\n##file 0\n"
"1: void f ( EventPtr * eventP , ActionPtr * * actionsP@1 )\n"
"2: {\n"
"3: EventPtr event@2 ; event@2 = * eventP ;\n"
"4: * actionsP@1 = & event@2 . actions@3 ;\n"
"5: }\n");
TODO_ASSERT_EQUALS(expected1, actual1, tokenizeDebugListing(code1));
ASSERT_EQUALS(expected1, tokenizeDebugListing(code1));
const std::string code2("void f(int b, int c) {\n"
" x(a*b*c,10);\n"