diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-08 17:18:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-08 17:18:35 +0000 |
commit | 5471bc85b69912e3b448de004498a80c0de32296 (patch) | |
tree | 722748ed81ac2868f8f853092a64891c338fbf99 /lib/Parse/ParseDecl.cpp | |
parent | 6aff47db98890aa537edfb579b21d11d5ea3d1cd (diff) |
Allow C++0x enumerations with a fixed underlying type in
Objective-C. The @encode'ing of such an enumeration type is the same
as its underlying type. <rdar://problem/5276348>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 4928bde002..40674ee7a9 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2555,7 +2555,8 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, ParsedAttributes attrs(AttrFactory); MaybeParseGNUAttributes(attrs); - bool AllowFixedUnderlyingType = getLang().CPlusPlus0x || getLang().Microsoft; + bool AllowFixedUnderlyingType + = getLang().CPlusPlus0x || getLang().Microsoft || getLang().ObjC2; CXXScopeSpec &SS = DS.getTypeSpecScope(); if (getLang().CPlusPlus) { @@ -2658,7 +2659,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, SourceRange Range; BaseType = ParseTypeName(&Range); - if (!getLang().CPlusPlus0x) + if (!getLang().CPlusPlus0x && !getLang().ObjC2) Diag(StartLoc, diag::ext_ms_enum_fixed_underlying_type) << Range; } |