diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index ba2520367..d29de46c5 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -101,6 +101,15 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti continue; } + // using namespace + else if (Token::Match(tok, "using namespace %type% ;|::")) + { + // save location + scope->usingList.push_back(tok); + + tok = tok->tokAt(3); + } + else { // check for end of space diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 038cf4318..8a9603dd5 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -400,7 +400,10 @@ public: AccessControl access; unsigned int numConstructors; NeedInitialization needInitialization; - Scope *functionOf; // class/struct this function belongs to + std::list usingList; + + // function specific fields + Scope *functionOf; // scope this function belongs to bool isClassOrStruct() const {