diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-17 22:40:11 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-17 22:40:11 +0000 |
commit | c0b8c81a0777cf3c7cfbe7c0a8cc5c86d1093a34 (patch) | |
tree | 00b107ab1ff1ca473e17bfc6e86ec61b2d1c8f9a /clang/lib/Sema/SemaDecl.cpp | |
parent | 1d793a5e0e4c9511c1f2ac7efe90fd7bad93ff86 (diff) | |
download | bcm5719-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.cpp | 2 |
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); |