From 836fadcb6a317ce312eeeb4a330579bfc76b4eb7 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sun, 13 Mar 2011 21:01:33 -0400 Subject: [PATCH] save location of using directive (not used yet) --- lib/symboldatabase.cpp | 9 +++++++++ lib/symboldatabase.h | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 {