From: Sebastian Redl Date: Thu, 5 Nov 2009 21:09:23 +0000 (+0000) Subject: The signed/unsigned checker should not warn for value-dependent expressions, and... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=732429cfb1f77c1af61e239d0664e65962e488b3;p=clang The signed/unsigned checker should not warn for value-dependent expressions, and should especially not try to evaluate them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86173 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f94017129b..f5bae072ef 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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;