This commit is contained in:
parent
3fd00c19df
commit
99e38cf8f8
|
@ -1103,7 +1103,7 @@ void SymbolDatabase::createSymbolDatabaseSetFunctionPointers(bool firstPass)
|
|||
|
||||
// Set function call pointers
|
||||
for (const Token* tok = mTokenizer.list.front(); tok != mTokenizer.list.back(); tok = tok->next()) {
|
||||
if (tok->isName() && !tok->function() && tok->varId() == 0 && Token::Match(tok, "%name% [{(,)>;]") && !isReservedName(tok->str())) {
|
||||
if (tok->isName() && !tok->function() && tok->varId() == 0 && ((tok->astParent() && tok->astParent()->isComparisonOp()) || Token::Match(tok, "%name% [{(,)>;]")) && !isReservedName(tok->str())) {
|
||||
if (tok->next()->str() == ">" && !tok->next()->link())
|
||||
continue;
|
||||
|
||||
|
|
|
@ -450,6 +450,7 @@ private:
|
|||
TEST_CASE(findFunction49); // #11888
|
||||
TEST_CASE(findFunction50); // #11904 - method with same name and arguments in derived class
|
||||
TEST_CASE(findFunction51); // #11975 - method with same name in derived class
|
||||
TEST_CASE(findFunction52);
|
||||
TEST_CASE(findFunctionContainer);
|
||||
TEST_CASE(findFunctionExternC);
|
||||
TEST_CASE(findFunctionGlobalScope); // ::foo
|
||||
|
@ -7558,6 +7559,16 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void findFunction52() {
|
||||
GET_SYMBOL_DB("int g();\n"
|
||||
"void f() {\n"
|
||||
" if (g != 0) {}\n"
|
||||
"}\n");
|
||||
const Token* g = Token::findsimplematch(tokenizer.tokens(), "g !=");
|
||||
ASSERT(g->function() && g->function()->tokenDef);
|
||||
ASSERT(g->function()->tokenDef->linenr() == 1);
|
||||
}
|
||||
|
||||
void findFunctionContainer() {
|
||||
{
|
||||
GET_SYMBOL_DB("void dostuff(std::vector<int> v);\n"
|
||||
|
|
Loading…
Reference in New Issue