diff options
author | John McCall <rjmccall@apple.com> | 2010-03-11 19:43:18 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-11 19:43:18 +0000 |
commit | d1b47bf17fde73fac67d8664bd65273742c00ecd (patch) | |
tree | 0cea232c72cbc5a9ebd3ad9079fe5e18e3e1dbec /lib/Sema/SemaExpr.cpp | |
parent | d7358a3a63e66aafc49f394613a3afe4403d7c6b (diff) |
Warn about comparing an unsigned expression with 0 in tautological ways.
Patch by mikem!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 2249579ba4..5d352ceb04 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4105,7 +4105,7 @@ QualType Sema::CheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS, if (getLangOptions().CPlusPlus) return CXXCheckConditionalOperands(Cond, LHS, RHS, QuestionLoc); - CheckSignCompare(LHS, RHS, QuestionLoc, diag::warn_mixed_sign_conditional); + CheckSignCompare(LHS, RHS, QuestionLoc); UsualUnaryConversions(Cond); UsualUnaryConversions(LHS); @@ -5282,8 +5282,7 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc, if (lex->getType()->isVectorType() || rex->getType()->isVectorType()) return CheckVectorCompareOperands(lex, rex, Loc, isRelational); - CheckSignCompare(lex, rex, Loc, diag::warn_mixed_sign_comparison, - (Opc == BinaryOperator::EQ || Opc == BinaryOperator::NE)); + CheckSignCompare(lex, rex, Loc, &Opc); // C99 6.5.8p3 / C99 6.5.9p4 if (lex->getType()->isArithmeticType() && rex->getType()->isArithmeticType()) |