aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-16 20:30:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-16 20:30:08 +0000
commit2aaad63ec5d012e6de40f72e114c60df9c205a24 (patch)
treefd1e0c71109ee3506fbe35561610c7430218107a /lib/Sema/SemaDecl.cpp
parent8663b180085e9bc7a0a87c80cc3f722efef99e79 (diff)
Make sure C-specific enum warning doesn't trigger in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index bf5b350da0..ca42cac72c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5812,7 +5812,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
const llvm::APSInt &InitVal = ECD->getInitVal();
assert(InitVal.getBitWidth() >= IntWidth &&
"Should have promoted value to int");
- if (InitVal.getBitWidth() > IntWidth) {
+ if (!getLangOptions().CPlusPlus && InitVal.getBitWidth() > IntWidth) {
llvm::APSInt V(InitVal);
V.trunc(IntWidth);
V.extend(InitVal.getBitWidth());