Fixed #9055 (SymbolDatabase: second argument is missing in the symbol database)
This commit is contained in:
parent
d88ee2d6a2
commit
fe285f1df3
|
@ -3034,7 +3034,11 @@ void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *s
|
|||
const Token* nameTok = nullptr;
|
||||
|
||||
do {
|
||||
if (tok->varId() != 0) {
|
||||
if (tok != startTok && !nameTok && Token::Match(tok, "( & %var% ) [")) {
|
||||
nameTok = tok->tokAt(2);
|
||||
endTok = nameTok->previous();
|
||||
tok = tok->link();
|
||||
} else if (tok->varId() != 0) {
|
||||
nameTok = tok;
|
||||
endTok = tok->previous();
|
||||
} else if (tok->str() == "[") {
|
||||
|
|
|
@ -215,6 +215,7 @@ private:
|
|||
TEST_CASE(functionArgs11);
|
||||
TEST_CASE(functionArgs12); // #7661
|
||||
TEST_CASE(functionArgs13); // #7697
|
||||
TEST_CASE(functionArgs14); // #9055
|
||||
|
||||
TEST_CASE(functionImplicitlyVirtual);
|
||||
|
||||
|
@ -2219,6 +2220,14 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void functionArgs14() { // #7697
|
||||
GET_SYMBOL_DB("void f(int (&a)[10], int (&b)[10]);");
|
||||
(void)db;
|
||||
const Function *func = tokenizer.tokens()->next()->function();
|
||||
ASSERT_EQUALS(true, func != nullptr);
|
||||
ASSERT_EQUALS(2, func ? func->argCount() : 0);
|
||||
}
|
||||
|
||||
void functionImplicitlyVirtual() {
|
||||
GET_SYMBOL_DB("class base { virtual void f(); };\n"
|
||||
"class derived : base { void f(); };\n"
|
||||
|
|
Loading…
Reference in New Issue