aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2012-03-01 04:09:28 +0000
committerAaron Ballman <aaron@aaronballman.com>2012-03-01 04:09:28 +0000
commit6454a02e7bbda180ef3867b6ae3c1aee327a34a7 (patch)
treedba2f12b27186e0dc354f00ddec4e8cacdd1497b /lib/Parse/ParseDecl.cpp
parent23f0267e2d56c0407f12e62df3561ecf75d74e6e (diff)
Added support for parsing declspecs on enumerations. Fixes PR8783
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 2d8271db40..591fe9ef3d 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -2871,6 +2871,8 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
///[C99/C++]'enum' identifier[opt] '{' enumerator-list ',' '}'
/// [GNU] 'enum' attributes[opt] identifier[opt] '{' enumerator-list ',' [opt]
/// '}' attributes[opt]
+/// [MS] 'enum' __declspec[opt] identifier[opt] '{' enumerator-list ',' [opt]
+/// '}'
/// 'enum' identifier
/// [GNU] 'enum' attributes[opt] identifier
///
@@ -2916,6 +2918,10 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
ParsedAttributes attrs(AttrFactory);
MaybeParseGNUAttributes(attrs);
+ // If declspecs exist after tag, parse them.
+ while (Tok.is(tok::kw___declspec))
+ ParseMicrosoftDeclSpec(attrs);
+
bool AllowFixedUnderlyingType
= getLang().CPlusPlus0x || getLang().MicrosoftExt || getLang().ObjC2;