summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaChecking.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 869296ad842..adc4c4a04b2 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5370,7 +5370,9 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E,
if (OtherRange.NonNegative) {
if (OtherWidth >= Value.getActiveBits())
return;
- } else if (!OtherRange.NonNegative && !ConstantSigned) {
+ } else { // OtherSigned
+ assert(!ConstantSigned &&
+ "Two signed types converted to unsigned types.");
// Check to see if the constant is representable in OtherT.
if (OtherWidth > Value.getActiveBits())
return;
@@ -5384,8 +5386,6 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E,
// after conversion. Relational comparison still works, but equality
// comparisons will be tautological.
EqualityOnly = true;
- } else { // OtherSigned && ConstantSigned
- llvm_unreachable("Two signed types converted to unsigned types.");
}
}
OpenPOWER on IntegriCloud