add support for anonymous struct to symbol database
This commit is contained in:
parent
e9a23d9cb5
commit
678486f0db
|
@ -110,8 +110,8 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
|
||||||
tok = tok->tokAt(3);
|
tok = tok->tokAt(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// anonymous union
|
// anonymous struct and union
|
||||||
else if (Token::Match(tok, "union {") &&
|
else if (Token::Match(tok, "struct|union {") &&
|
||||||
Token::Match(tok->next()->link(), "} %var% ;"))
|
Token::Match(tok->next()->link(), "} %var% ;"))
|
||||||
{
|
{
|
||||||
scopeList.push_back(Scope(this, tok, scope));
|
scopeList.push_back(Scope(this, tok, scope));
|
||||||
|
@ -1338,6 +1338,8 @@ Scope::Scope(SymbolDatabase *check_, const Token *classDef_, Scope *nestedIn_) :
|
||||||
else if (classDef->str() == "struct")
|
else if (classDef->str() == "struct")
|
||||||
{
|
{
|
||||||
type = Scope::eStruct;
|
type = Scope::eStruct;
|
||||||
|
// anonymous structs don't have a name
|
||||||
|
if (classDef->next()->str() != "{")
|
||||||
className = classDef->next()->str();
|
className = classDef->next()->str();
|
||||||
access = Public;
|
access = Public;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue