Don't warn -Wsign-compare if we're in an unevaluated context, and fixed
a typo pointed out by Fariborz.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86265 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 7f71f9c..9a549f1 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -4454,6 +4454,10 @@
/// suppresses the warning in some cases
void Sema::CheckSignCompare(Expr *lex, Expr *rex, SourceLocation OpLoc,
const PartialDiagnostic &PD, bool Equality) {
+ // Don't warn if we're in an unevaluated context.
+ if (ExprEvalContext == Unevaluated)
+ return;
+
QualType lt = lex->getType(), rt = rex->getType();
// Only warn if both operands are integral.