diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-21 07:22:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-21 07:22:56 +0000 |
commit | b14dbd73b9d25673581e3b6c277d3453f0d3fa55 (patch) | |
tree | bf68eca6b334b116dfb6a7c398f773e1107d7b95 /clang/lib/Sema/SemaChecking.cpp | |
parent | 79ebc7186e5bd152b0e8bd3006ea2690a97204c5 (diff) | |
download | bcm5719-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.cpp | 3 |
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()) |