This commit is contained in:
parent
4af2f991c2
commit
dc19916966
|
@ -1510,6 +1510,16 @@ void SymbolDatabase::createSymbolDatabaseIncompleteVars()
|
|||
continue;
|
||||
if (mSettings.standards.cpp >= Standards::CPP20 && cpp20keywords.count(tok->str()) > 0)
|
||||
continue;
|
||||
std::string fstr = tok->str();
|
||||
const Token* ftok = tok->previous();
|
||||
while (Token::simpleMatch(ftok, "::")) {
|
||||
if (!Token::Match(ftok->previous(), "%name%"))
|
||||
break;
|
||||
fstr.insert(0, ftok->previous()->str() + "::");
|
||||
ftok = ftok->tokAt(-2);
|
||||
}
|
||||
if (mSettings.library.functions.find(fstr) != mSettings.library.functions.end())
|
||||
continue;
|
||||
const_cast<Token *>(tok)->isIncompleteVar(true); // TODO: avoid const_cast
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5464,6 +5464,21 @@ private:
|
|||
const Token* s4 = Token::findsimplematch(s3->next(), "string )");
|
||||
ASSERT(s4 && !s4->isIncompleteVar());
|
||||
}
|
||||
{
|
||||
GET_SYMBOL_DB("void destroy(int*, void (*cb_dealloc)(void *));\n"
|
||||
"void f(int* p, int* q, int* r) {\n"
|
||||
" destroy(p, free);\n"
|
||||
" destroy(q, std::free);\n"
|
||||
" destroy(r, N::free);\n"
|
||||
"}\n");
|
||||
ASSERT(db && errout.str().empty());
|
||||
const Token* free1 = Token::findsimplematch(tokenizer.tokens(), "free");
|
||||
ASSERT(free1 && !free1->isIncompleteVar());
|
||||
const Token* free2 = Token::findsimplematch(free1->next(), "free");
|
||||
ASSERT(free2 && !free2->isIncompleteVar());
|
||||
const Token* free3 = Token::findsimplematch(free2->next(), "free");
|
||||
ASSERT(free3 && free3->isIncompleteVar());
|
||||
}
|
||||
}
|
||||
|
||||
void enum1() {
|
||||
|
|
Loading…
Reference in New Issue