Symbol database: handle anonymous namespace

This commit is contained in:
Robert Reif 2014-09-24 06:09:08 +02:00 committed by Daniel Marjamäki
parent 1e8c7e102d
commit 194e4a71a4
1 changed files with 4 additions and 3 deletions

View File

@ -254,9 +254,10 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
tok = tok2;
}
// anonymous struct and union
else if (Token::Match(tok, "struct|union {") &&
Token::simpleMatch(tok->next()->link(), "} ;")) {
// anonymous struct, union and namespace
else if ((Token::Match(tok, "struct|union {") &&
Token::simpleMatch(tok->next()->link(), "} ;")) ||
Token::simpleMatch(tok, "namespace {")) {
scopeList.push_back(Scope(this, tok, scope));
Scope *new_scope = &scopeList.back();