summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-21 07:22:56 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-21 07:22:56 +0000
commitb14dbd73b9d25673581e3b6c277d3453f0d3fa55 (patch)
treebf68eca6b334b116dfb6a7c398f773e1107d7b95 /clang/lib/Sema/SemaChecking.cpp
parent79ebc7186e5bd152b0e8bd3006ea2690a97204c5 (diff)
downloadbcm5719-llvm-b14dbd73b9d25673581e3b6c277d3453f0d3fa55.tar.gz
bcm5719-llvm-b14dbd73b9d25673581e3b6c277d3453f0d3fa55.zip
Don't try to compute the value of a value-dependent expression when
checking trivial comparisons. Fixes PR8795. llvm-svn: 122322
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index c75b27c3ecc..75b30fcb769 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -2527,6 +2527,9 @@ static bool HasEnumType(Expr *E) {
void CheckTrivialUnsignedComparison(Sema &S, BinaryOperator *E) {
BinaryOperatorKind op = E->getOpcode();
+ if (E->isValueDependent())
+ return;
+
if (op == BO_LT && IsZero(S, E->getRHS())) {
S.Diag(E->getOperatorLoc(), diag::warn_lunsigned_always_true_comparison)
<< "< 0" << "false" << HasEnumType(E->getLHS())
OpenPOWER on IntegriCloud