forked from qt-creator/qt-creator
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:
committed by
Nikolai Kosjar
parent
aae1abdacc
commit
b90452e309
12
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
12
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user