summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-01-10 04:38:09 +0000
committerRichard Trieu <rtrieu@google.com>2014-01-10 04:38:09 +0000
commitc38786be00778e8ad87fb0d50c3ce00a7ca84efb (patch)
tree3d771cda53ee8d6c0c1afb829dc6d8757c82124b /clang/lib/Sema
parent91a8e03af0426c28ee623dda455a051f85b7352d (diff)
downloadbcm5719-llvm-c38786be00778e8ad87fb0d50c3ce00a7ca84efb.tar.gz
bcm5719-llvm-c38786be00778e8ad87fb0d50c3ce00a7ca84efb.zip
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
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index b6fc020b1de..82b3da6c2e1 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -4970,9 +4970,11 @@ static void DiagnoseOutOfRangeComparison(Sema &S, BinaryOperator *E,
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
OpenPOWER on IntegriCloud