From 0b7c85fc5a2889d5cf6979aff4623c7d390cda13 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Thu, 5 Nov 2009 21:09:23 +0000 Subject: [PATCH] The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them. llvm-svn: 86173 --- clang/lib/Sema/SemaExpr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index f94017129b02..f5bae072ef0e 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;