summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-17 22:40:11 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-17 22:40:11 +0000
commitc0b8c81a0777cf3c7cfbe7c0a8cc5c86d1093a34 (patch)
tree00b107ab1ff1ca473e17bfc6e86ec61b2d1c8f9a /clang/lib/Sema/SemaDecl.cpp
parent1d793a5e0e4c9511c1f2ac7efe90fd7bad93ff86 (diff)
downloadbcm5719-llvm-c0b8c81a0777cf3c7cfbe7c0a8cc5c86d1093a34.tar.gz
bcm5719-llvm-c0b8c81a0777cf3c7cfbe7c0a8cc5c86d1093a34.zip
When diagnosing enumerator values outside of the range of 'int', be
sure that we get the "too large" vs. "too small" part of the diagnostic correct. llvm-svn: 96524
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 38211134393..e7217dc2200 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5732,7 +5732,7 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy))
Diag(IdLoc, diag::ext_enum_value_not_int)
<< EnumVal.toString(10) << Val->getSourceRange()
- << EnumVal.isNonNegative();
+ << (EnumVal.isUnsigned() || EnumVal.isNonNegative());
else if (!Context.hasSameType(Val->getType(), Context.IntTy)) {
// Force the type of the expression to 'int'.
ImpCastExprToType(Val, Context.IntTy, CastExpr::CK_IntegralCast);
OpenPOWER on IntegriCloud