diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 0c730c8be..3f5016dba 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1428,13 +1428,8 @@ Function* SymbolDatabase::addGlobalFunctionDecl(Scope*& scope, const Token *tok, void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const Token *argStart) { - int count = 0; - std::string path; - unsigned int path_length = 0; - const Token *tok1; - const bool destructor((*tok)->previous()->str() == "~"); - + const Token *tok1; // skip class/struct name if (destructor) tok1 = (*tok)->tokAt(-3); @@ -1445,6 +1440,10 @@ void SymbolDatabase::addClassFunction(Scope **scope, const Token **tok, const To if (!tok1) return; + int count = 0; + std::string path; + unsigned int path_length = 0; + // back up to head of path while (tok1 && tok1->previous() && tok1->previous()->str() == "::" && tok1->tokAt(-2) && tok1->tokAt(-2)->isName()) {