diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 2f242cb9f..0428e6551 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1485,13 +1485,6 @@ void Scope::getVariableList() continue; } - //skip 'using (namespace)' keyword - else if (tok->str() == "using") { - if (tok->next() && tok->next()->str() == "namespace") - tok = tok->next(); - continue; - } - // Search for start of statement.. else if (tok->previous() && !Token::Match(tok->previous(), ";|{|}|public:|protected:|private:")) continue; diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d767463e9..7fee9a985 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -3647,9 +3647,12 @@ void Tokenizer::setVarId() if (tok->str() == "unsigned") tok = tok->next(); + if (Token::Match(tok, "using namespace %type% ;")) { + tok = tok->next(); + continue; + } + if (tok->str() == "using") { - if (tok->next() && tok->next()->str() == "namespace") - tok = tok->next(); continue; }