diff options
author | John McCall <rjmccall@apple.com> | 2010-10-22 23:36:17 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-22 23:36:17 +0000 |
commit | 811a0f5578e3898f53724e234b66e9969ddb5aad (patch) | |
tree | 97c22a0ccebaaad9aa9dae871735bd96d41c1ab0 /clang/lib/Parse/ParseDecl.cpp | |
parent | 21836f726b34c3f1050a812f1562557e6bbe38f8 (diff) | |
download | bcm5719-llvm-811a0f5578e3898f53724e234b66e9969ddb5aad.tar.gz bcm5719-llvm-811a0f5578e3898f53724e234b66e9969ddb5aad.zip |
Parse attributes on enumerators and instantiate attributes on enum decls.
llvm-svn: 117182
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 35a35f33b5c..9e430a42968 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2124,6 +2124,11 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) { IdentifierInfo *Ident = Tok.getIdentifierInfo(); SourceLocation IdentLoc = ConsumeToken(); + // If attributes exist after the enumerator, parse them. + llvm::OwningPtr<AttributeList> Attr; + if (Tok.is(tok::kw___attribute)) + Attr.reset(ParseGNUAttributes()); + SourceLocation EqualLoc; ExprResult AssignedVal; if (Tok.is(tok::equal)) { @@ -2137,7 +2142,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) { Decl *EnumConstDecl = Actions.ActOnEnumConstant(getCurScope(), EnumDecl, LastEnumConstDecl, IdentLoc, Ident, - EqualLoc, + Attr.get(), EqualLoc, AssignedVal.release()); EnumConstantDecls.push_back(EnumConstDecl); LastEnumConstDecl = EnumConstDecl; |