summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-03-25 22:22:35 +0000
committerDouglas Gregor <dgregor@apple.com>2013-03-25 22:22:35 +0000
commit780420ea4ec6a587969d48747f2b4c018cd03ae9 (patch)
tree111f6355769771316b62229d97e206d5de6fb2e4 /clang/lib/Sema/SemaDecl.cpp
parentea1bbbd1359fbacd5bd874baf590a5c1f08429b5 (diff)
downloadbcm5719-llvm-780420ea4ec6a587969d48747f2b4c018cd03ae9.tar.gz
bcm5719-llvm-780420ea4ec6a587969d48747f2b4c018cd03ae9.zip
<rdar://problem/13459871> Allow forward declaration of enums with a fixed underlying type in Objective-C (as well as C++11).
llvm-svn: 177930
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5597bf60097..cb05bb0099e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9858,7 +9858,8 @@ CreateNewDecl:
// If this is an undefined enum, warn.
if (TUK != TUK_Definition && !Invalid) {
TagDecl *Def;
- if (getLangOpts().CPlusPlus11 && cast<EnumDecl>(New)->isFixed()) {
+ if ((getLangOpts().CPlusPlus11 || getLangOpts().ObjC2) &&
+ cast<EnumDecl>(New)->isFixed()) {
// C++0x: 7.2p2: opaque-enum-declaration.
// Conflicts are diagnosed above. Do nothing.
}
OpenPOWER on IntegriCloud