C++: fix nested anonymous with __attribute__

Task-number: QTCREATORBUG-12345
Change-Id: Ib2316ebdc81393b38185b9cb659fb85b78753e7b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Przemyslaw Gorszkowski
2014-06-05 09:05:41 +02:00
committed by Nikolai Kosjar
parent aae1abdacc
commit b90452e309
3 changed files with 58 additions and 6 deletions

View File

@@ -1988,12 +1988,6 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
NameAST *name = 0;
parseName(name);
if (! name && LA() == T_LBRACE && (LA(0) == T_CLASS || LA(0) == T_STRUCT || LA(0) == T_UNION || LA(0) == T_ENUM)) {
AnonymousNameAST *ast = new (_pool) AnonymousNameAST;
ast->class_token = classkey_token;
name = ast;
}
bool parsed = false;
const bool previousInFunctionBody = _inFunctionBody;
@@ -2010,6 +2004,12 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node)
}
if (LA() == T_COLON || LA() == T_LBRACE) {
if (!name) {
AnonymousNameAST *ast = new (_pool) AnonymousNameAST;
ast->class_token = classkey_token;
name = ast;
}
BaseSpecifierListAST *base_clause_list = 0;
if (LA() == T_COLON) {