SymbolDatabase::isFunction: better handling of return types

This commit is contained in:
Daniel Marjamäki 2018-04-29 15:35:31 +02:00
parent 45c4456c24
commit 7015fb097e
2 changed files with 2 additions and 2 deletions

View File

@ -1393,7 +1393,7 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
// done if constructor or destructor
if (!Token::Match(tok1, "{|}|;|public:|protected:|private:") && tok1) {
// skip over pointers and references
while (Token::Match(tok1, "[*&]"))
while (Token::Match(tok1, "%type%|*|&") && !endsWith(tok1->str(), ':') && (!isReservedName(tok1->str()) || tok1->str() == "const"))
tok1 = tok1->previous();
// skip over template

View File

@ -3774,7 +3774,7 @@ private:
ASSERT(db != nullptr);
ASSERT(db && !db->isFunction(Token::findsimplematch(tokenizer.tokens(), "PTRRELOC ( &"), &db->scopeList.back(), nullptr, nullptr, nullptr));
ASSERT(db->findScopeByName("set_cur_cpu_spec") != nullptr);
// TODO: ASSERT(db->findScopeByName("setup_cpu_spec") != nullptr);
ASSERT(db->findScopeByName("setup_cpu_spec") != nullptr);
ASSERT(db->findScopeByName("PTRRELOC") == nullptr);
}