1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Declspec in enum-specifier, bug 241203.

This commit is contained in:
Markus Schorn 2008-07-25 13:32:14 +00:00
parent 8755869f67
commit ec58119cbe
2 changed files with 11 additions and 13 deletions

View file

@ -5238,4 +5238,10 @@ public class AST2Tests extends AST2BaseTest {
parseAndCheckBindings(getAboveComment(), ParserLanguage.C, true);
}
// enum __declspec(uuid("uuid")) bla { a, b};
public void testDeclspecInEnumSpecifier_bug241203() throws Exception {
for (ParserLanguage lang : ParserLanguage.values()) {
parseAndCheckBindings(getAboveComment(), lang, true);
}
}
}

View file

@ -1260,6 +1260,9 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
final IToken mark= mark();
final int offset= consume().getOffset();
// if __attribute__ or __declspec occurs after struct/union/class and before the identifier
__attribute_decl_seq(supportAttributeSpecifiers, supportDeclspecSpecifiers);
IASTName name;
if (LT(1) == IToken.tIDENTIFIER) {
name= createName(identifier());
@ -2215,21 +2218,10 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
protected void __declspec() throws BacktrackException, EndOfFileException {
IToken token = LA(1);
if (token.getType() == IGCCToken.t__declspec) {
consume();
token = LA(1);
if (token.getType() == IToken.tLPAREN) {
consume();
while(true) {
token = LA(1);
consume();
if (token.getType() == IToken.tRPAREN) {
break;
}
}
if (LT(1) == IToken.tLPAREN) {
skipBrackets(IToken.tLPAREN, IToken.tRPAREN);
}
}
}