aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-31 01:47:46 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-31 01:47:46 +0000
commit395f1c08ff720be7df6535a86df14b6d36a2d57a (patch)
tree1494d753d6bcbcb74253dd5be3ddd1bda31c3388 /lib/AST/ExprConstant.cpp
parent339b9072e26a2a0fe796dc69c4d28d964d0ec86d (diff)
constexpr: remove integral conversion overflow checking introduced in r149286.
As Eli points out, this is implementation-defined, and the way we define it makes this fine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index d2d651c97f..50e96bdd4b 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -1094,13 +1094,6 @@ static APSInt HandleIntToIntCast(EvalInfo &Info, const Expr *E,
// Figure out if this is a truncate, extend or noop cast.
// If the input is signed, do a sign extend, noop, or truncate.
Result = Result.extOrTrunc(DestWidth);
-
- // Check whether we overflowed. If so, fold the cast anyway.
- if (DestType->isSignedIntegerOrEnumerationType() &&
- ((Result.isNegative() && Value.isUnsigned()) ||
- Result.extOrTrunc(Value.getBitWidth()) != Value))
- (void)HandleOverflow(Info, E, Value, DestType);
-
Result.setIsUnsigned(DestType->isUnsignedIntegerOrEnumerationType());
return Result;
}