Fixed #6571 (Library::isNotLibraryFunction: Return true for methods)

This commit is contained in:
Daniel Marjamäki 2015-03-08 16:13:32 +01:00
parent 92de2a3ca3
commit 2d8a6c7b89
1 changed files with 3 additions and 0 deletions

View File

@ -681,9 +681,12 @@ const Library::Container* Library::detectContainer(const Token* typeStart) const
// returns true if ftok is not a library function // returns true if ftok is not a library function
bool Library::isNotLibraryFunction(const Token *ftok) const bool Library::isNotLibraryFunction(const Token *ftok) const
{ {
// methods are not library functions
// called from tokenizer, ast is not created properly yet // called from tokenizer, ast is not created properly yet
if (Token::Match(ftok->previous(),"::|.")) if (Token::Match(ftok->previous(),"::|."))
return true; return true;
if (ftok->function() && ftok->function()->nestedIn && ftok->function()->nestedIn->type != Scope::eGlobal)
return true;
// variables are not library functions. // variables are not library functions.
if (ftok->varId()) if (ftok->varId())