1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

Attributes in elaborated type specifiers, bug 227085.

This commit is contained in:
Markus Schorn 2008-04-15 07:58:54 +00:00
parent 9594a52283
commit 51f43ad2c5
3 changed files with 13 additions and 0 deletions

View file

@ -4524,4 +4524,11 @@ public class AST2Tests extends AST2BaseTest {
parseAndCheckBindings(code, ParserLanguage.CPP);
}
// struct __attribute__((declspec)) bla;
public void testAttributeInElaboratedTypeSpecifier_Bug227085() throws Exception {
final String code = getAboveComment();
parseAndCheckBindings(code, ParserLanguage.C, true);
parseAndCheckBindings(code, ParserLanguage.CPP, true);
}
}

View file

@ -1529,6 +1529,9 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
throwBacktrack(t.getOffset(), t.getLength());
}
// if __attribute__ or __declspec occurs after struct/union/class and before the identifier
__attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
IToken identifier = identifier();
IASTName name = createName(identifier);
ICASTElaboratedTypeSpecifier result = createElaboratedTypeSpecifier();

View file

@ -3285,6 +3285,9 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
throwBacktrack(t.getOffset(), t.getLength());
}
// if __attribute__ or __declspec occurs after struct/union/class and before the identifier
__attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
IASTName name = createName(name());
ICPPASTElaboratedTypeSpecifier elaboratedTypeSpec = createElaboratedTypeSpecifier();