summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2019-01-18 21:33:23 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2019-01-18 21:33:23 +0000
commit14d47cfd494a41176bee0442e6c15dbbc85f1f95 (patch)
tree36176b06ef7ecddf9e1d4c4b1a5e110fefb58531 /clang/lib/Sema/SemaDecl.cpp
parentbd3a5b29cb809fc6117569a2801d41c1d12dfe9a (diff)
downloadbcm5719-llvm-14d47cfd494a41176bee0442e6c15dbbc85f1f95.tar.gz
bcm5719-llvm-14d47cfd494a41176bee0442e6c15dbbc85f1f95.zip
[Sema] Suppress a warning about a forward-declared fixed enum in C mode
As of r343360, we support fixed-enums in C. This lead to some warnings in project headers where a fixed enum is forward declared then later defined. In C++, this is fine, the forward declaration is treated as a complete type even though the definition isn't present. We use this rule in C too, but still warn about the forward declaration anyways. This patch suppresses the warning. rdar://problem/47356469 Differential revision: https://reviews.llvm.org/D56879 llvm-svn: 351595
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 03061eab359..a5a4833a5c1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -14747,8 +14747,7 @@ CreateNewDecl:
// If this is an undefined enum, warn.
if (TUK != TUK_Definition && !Invalid) {
TagDecl *Def;
- if (IsFixed && (getLangOpts().CPlusPlus11 || getLangOpts().ObjC) &&
- cast<EnumDecl>(New)->isFixed()) {
+ if (IsFixed && cast<EnumDecl>(New)->isFixed()) {
// C++0x: 7.2p2: opaque-enum-declaration.
// Conflicts are diagnosed above. Do nothing.
}
OpenPOWER on IntegriCloud