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 | 19c152581a46dd162c0cfacad05ad88646d527c5 (patch) | |
tree | 92a500aa026c6fd94fc99993d8bd0f22c5b207a1 /lib/Sema/SemaDecl.cpp | |
parent | 04a2311982d34269f84362a02a7a76a3e47675bc (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 3821113439..e7217dc220 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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); |