CplusPlus: Fix type information for anonymous enums

Variables declared like this:
    enum { E1, E2 } e;
would not get assigned a proper type.

Task-number: QTCREATORBUG-7487
Change-Id: I4362f22feb0f2e4e1e754e9c623e5576fa31f4bc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-04 12:31:43 +02:00
parent 93d5ed4073
commit 2262af087a
2 changed files with 29 additions and 1 deletions

View File

@@ -3176,7 +3176,10 @@ bool Bind::visit(EnumSpecifierAST *ast)
}
(void) switchScope(previousScope);
_type.setType(control()->namedType(this->name(ast->name)));
if (ast->name)
_type.setType(control()->namedType(this->name(ast->name)));
else
_type.setType(ast->symbol);
return false;
}