Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olabetskyi committed Feb 12, 2024
1 parent 73e6517 commit 0d1a400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
tok = tok->link();
}
} else if (Token::Match(tok, "%name% (")) {
if (tok->next() && Token::simpleMatch(tok->next()->link(), ") ;")) {
if (Token::simpleMatch(tok->linkAt(1), ") ;")) {
const Token *funcStart = nullptr;
const Token *argStart = nullptr;
const Token *declEnd = nullptr;
Expand Down
5 changes: 4 additions & 1 deletion test/testsymboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,10 @@ class TestSymbolDatabase : public TestFixture {
ASSERT(db && errout.str().empty());

const Token *f = Token::findsimplematch(tokenizer.tokens(), "bar");
ASSERT(f && f->function() && f->function()->isExtern() && f->function()->retDef->str() == "void");
ASSERT(f && f->function() && f->function()->isExtern() && f == f->function()->tokenDef && f->function()->retDef->str() == "void");

const Token *call = Token::findsimplematch(f->next(), "bar");
ASSERT(call && call->function() && call->function()->isExtern() && call->function() == f->function());
}

void classWithFriend() {
Expand Down

0 comments on commit 0d1a400

Please sign in to comment.