diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-05 21:09:23 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-11-05 21:09:23 +0000 |
commit | 0b7c85fc5a2889d5cf6979aff4623c7d390cda13 (patch) | |
tree | c549ee620eee0e7d5a38e8f85c5972a4601664a2 /clang | |
parent | bed7cb6c1ddbbe9f50d68ae8200601b8188e6f5c (diff) | |
download | bcm5719-llvm-0b7c85fc5a2889d5cf6979aff4623c7d390cda13.tar.gz bcm5719-llvm-0b7c85fc5a2889d5cf6979aff4623c7d390cda13.zip |
The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them.
llvm-svn: 86173
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index f94017129b0..f5bae072ef0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4434,6 +4434,11 @@ void Sema::CheckSignCompare(Expr *lex, Expr *rex, SourceLocation OpLoc, if (!lt->isIntegerType() || !rt->isIntegerType()) return; + // If either expression is value-dependent, don't warn. We'll get another + // chance at instantiation time. + if (lex->isValueDependent() || rex->isValueDependent()) + return; + // The rule is that the signed operand becomes unsigned, so isolate the // signed operand. Expr *signedOperand; |