mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 03:45:35 +02:00
Attributes in elaborated type specifiers, bug 227085.
This commit is contained in:
parent
9594a52283
commit
51f43ad2c5
3 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1528,6 +1528,9 @@ public class GNUCSourceParser extends AbstractGNUSourceCodeParser {
|
|||
backup(t);
|
||||
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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue