C++: Fix parsing enum specifier II

This amends the obviously wrong
de975aca4f, which did not honored nameless
enum specifiers.

This fixes e.g. "Find Usages" for declarations following "enum {};".

Change-Id: Id98c074156f576b9a63e6c25dab38721ca34e496
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-10-23 08:24:06 +02:00
parent 623294cd38
commit aac1bebace
2 changed files with 10 additions and 3 deletions

View File

@@ -1835,10 +1835,8 @@ bool Parser::parseEnumSpecifier(SpecifierListAST *&node)
return false;
}
if (LA() == T_IDENTIFIER)
if (LA() == T_COLON_COLON && LA() == T_IDENTIFIER)
parseName(ast->name);
else
return false;
if (_languageFeatures.cxx11Enabled && LA() == T_COLON) {
ast->colon_token = consumeToken();