diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 32a447ca1..e587b0440 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1389,8 +1389,7 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const // regular function? else if (Token::Match(tok, "%name% (") && !isReservedName(tok->str()) && tok->previous() && - (tok->previous()->isName() || tok->strAt(-1) == ">" || tok->strAt(-1) == "&" || tok->strAt(-1) == "*" || // Either a return type in front of tok - tok->strAt(-1) == "::" || tok->strAt(-1) == "~" || // or a scope qualifier in front of tok + (Token::Match(tok->previous(), "%name%|>|&|*|::|~") || // Either a return type or scope qualifier in front of tok outerScope->isClassOrStruct())) { // or a ctor/dtor const Token* tok1 = tok->previous(); const Token* tok2 = tok->next()->link()->next();