diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-07-23 00:25:18 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-07-23 00:25:18 +0000 |
| commit | 088d39afc6c4fbaadb25fc31e733de2ce4422cab (patch) | |
| tree | 79524a848da90b6f5c83a591c4bfeddc3eb888e4 /clang/lib/Sema | |
| parent | 9974c88f7697a569ade90f7b136a2d07e98d9fe0 (diff) | |
| download | bcm5719-llvm-088d39afc6c4fbaadb25fc31e733de2ce4422cab.tar.gz bcm5719-llvm-088d39afc6c4fbaadb25fc31e733de2ce4422cab.zip | |
Integers which are too large should be an error.
Switch some warnings over to errors which should never have been warnings
in the first place. (Also, a minor fix to the preprocessor rules for
integer literals while I'm here.)
llvm-svn: 186903
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 16b5e3cf008..8b7829d8a5d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2909,7 +2909,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { } else { llvm::APInt ResultVal(Context.getTargetInfo().getLongLongWidth(), 0); if (Literal.GetIntegerValue(ResultVal)) - Diag(Tok.getLocation(), diag::warn_integer_too_large); + Diag(Tok.getLocation(), diag::err_integer_too_large); Lit = IntegerLiteral::Create(Context, ResultVal, CookedTy, Tok.getLocation()); } @@ -3002,8 +3002,8 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { llvm::APInt ResultVal(MaxWidth, 0); if (Literal.GetIntegerValue(ResultVal)) { - // If this value didn't fit into uintmax_t, warn and force to ull. - Diag(Tok.getLocation(), diag::warn_integer_too_large); + // If this value didn't fit into uintmax_t, error and force to ull. + Diag(Tok.getLocation(), diag::err_integer_too_large); Ty = Context.UnsignedLongLongTy; assert(Context.getTypeSize(Ty) == ResultVal.getBitWidth() && "long long is not intmax_t?"); @@ -3079,7 +3079,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // If we still couldn't decide a type, we probably have something that // does not fit in a signed long long, but has no U suffix. if (Ty.isNull()) { - Diag(Tok.getLocation(), diag::warn_integer_too_large_for_signed); + Diag(Tok.getLocation(), diag::err_integer_too_large_for_signed); Ty = Context.UnsignedLongLongTy; Width = Context.getTargetInfo().getLongLongWidth(); } |

