SymbolDatabase: Function::retDef should not point at "static" or "extern"
This commit is contained in:
parent
7b1ed9f415
commit
36d12d7866
|
@ -1899,7 +1899,7 @@ Function* SymbolDatabase::addGlobalFunctionDecl(Scope*& scope, const Token *tok,
|
|||
tok1 = tok1->previous();
|
||||
|
||||
// find the return type
|
||||
while (tok1 && Token::Match(tok1->next(), "static|extern|const")) {
|
||||
while (Token::Match(tok1, "static|extern|const")) {
|
||||
if (tok1->str() == "static")
|
||||
function.isStaticLocal(true);
|
||||
else if (tok1->str() == "extern")
|
||||
|
|
|
@ -1350,22 +1350,22 @@ private:
|
|||
|
||||
if (db) {
|
||||
const Token *f = Token::findsimplematch(tokenizer.tokens(), "f1");
|
||||
ASSERT(f && f->function() && f->function()->isStaticLocal());
|
||||
ASSERT(f && f->function() && f->function()->isStaticLocal() && f->function()->retDef->str() == "void");
|
||||
|
||||
f = Token::findsimplematch(tokenizer.tokens(), "f2");
|
||||
ASSERT(f && f->function() && !f->function()->isStaticLocal());
|
||||
ASSERT(f && f->function() && !f->function()->isStaticLocal() && f->function()->retDef->str() == "void");
|
||||
|
||||
f = Token::findsimplematch(tokenizer.tokens(), "f3");
|
||||
ASSERT(f && f->function() && f->function()->isExtern());
|
||||
ASSERT(f && f->function() && f->function()->isExtern() && f->function()->retDef->str() == "void");
|
||||
|
||||
f = Token::findsimplematch(tokenizer.tokens(), "f4");
|
||||
ASSERT(f && f->function() && !f->function()->isExtern());
|
||||
ASSERT(f && f->function() && !f->function()->isExtern() && f->function()->retDef->str() == "void");
|
||||
|
||||
f = Token::findsimplematch(tokenizer.tokens(), "f5");
|
||||
ASSERT(f && f->function() && f->function()->isExtern());
|
||||
ASSERT(f && f->function() && f->function()->isExtern() && f->function()->retDef->str() == "void");
|
||||
|
||||
f = Token::findsimplematch(tokenizer.tokens(), "f6");
|
||||
ASSERT(f && f->function() && !f->function()->isExtern());
|
||||
ASSERT(f && f->function() && !f->function()->isExtern() && f->function()->retDef->str() == "void");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue