diff options
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 6 | ||||
-rw-r--r-- | test/Parser/MicrosoftExtensions.c | 4 |
2 files changed, 8 insertions, 2 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; diff --git a/test/Parser/MicrosoftExtensions.c b/test/Parser/MicrosoftExtensions.c index a0f15e9d86..5f457293fa 100644 --- a/test/Parser/MicrosoftExtensions.c +++ b/test/Parser/MicrosoftExtensions.c @@ -49,8 +49,8 @@ char x = FOO(a); typedef enum E { e1 }; - - +enum __declspec(deprecated) E2 { i, j, k }; +__declspec(deprecated) enum E3 { a, b, c } e; /* Microsoft attribute tests */ |