Make the tautological out of range warning use Sema::DiagRuntimeBehavior so that
the warning will not trigger on code protected by compile time checks.
llvm-svn: 198913
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index b6fc020..82b3da6 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -4970,9 +4970,11 @@
else
OS << Value;
- S.Diag(E->getOperatorLoc(), diag::warn_out_of_range_compare)
- << OS.str() << OtherT << IsTrue
- << E->getLHS()->getSourceRange() << E->getRHS()->getSourceRange();
+ S.DiagRuntimeBehavior(E->getOperatorLoc(), E,
+ S.PDiag(diag::warn_out_of_range_compare)
+ << OS.str() << OtherT << IsTrue
+ << E->getLHS()->getSourceRange()
+ << E->getRHS()->getSourceRange());
}
/// Analyze the operands of the given comparison. Implements the