fixed #2614 (missing varid on function parameter)
This commit is contained in:
parent
6750c7b492
commit
cd64d8476c
|
@ -3413,7 +3413,8 @@ void Tokenizer::setVarId()
|
||||||
continue;
|
continue;
|
||||||
if (tok->strAt(-1) == "return")
|
if (tok->strAt(-1) == "return")
|
||||||
continue;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ private:
|
||||||
" EventPtr event = *eventP;\n"
|
" EventPtr event = *eventP;\n"
|
||||||
" *actionsP = &event->actions;\n"
|
" *actionsP = &event->actions;\n"
|
||||||
"}\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()
|
void returnLocalVariable1()
|
||||||
|
|
|
@ -2865,13 +2865,7 @@ private:
|
||||||
"3: EventPtr event@3 ; event@3 = * eventP@1 ;\n"
|
"3: EventPtr event@3 ; event@3 = * eventP@1 ;\n"
|
||||||
"4: * actionsP@2 = & event@3 . actions@4 ;\n"
|
"4: * actionsP@2 = & event@3 . actions@4 ;\n"
|
||||||
"5: }\n");
|
"5: }\n");
|
||||||
const std::string actual1("\n\n##file 0\n"
|
ASSERT_EQUALS(expected1, tokenizeDebugListing(code1));
|
||||||
"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));
|
|
||||||
|
|
||||||
const std::string code2("void f(int b, int c) {\n"
|
const std::string code2("void f(int b, int c) {\n"
|
||||||
" x(a*b*c,10);\n"
|
" x(a*b*c,10);\n"
|
||||||
|
|
Loading…
Reference in New Issue