diff options
author | Ryan Flynn <pizza@parseerror.com> | 2009-08-08 19:18:23 +0000 |
---|---|---|
committer | Ryan Flynn <pizza@parseerror.com> | 2009-08-08 19:18:23 +0000 |
commit | 8045c7393bc83060f812d0f7b1221edbc767407c (patch) | |
tree | 08549650519022dd367971312f433d865c1f0c17 /lib | |
parent | a860e755f1f9f071b6a6a2f96128a6a258f5c331 (diff) |
PR4700 - remove shift by 0 warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index cec1aeafac..f00ab5412d 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4136,16 +4136,7 @@ QualType Sema::CheckShiftOperands(Expr *&lex, Expr *&rex, SourceLocation Loc, llvm::APSInt Right; // Check right/shifter operand if (rex->isIntegerConstantExpr(Right, Context)) { - // Check left/shiftee operand - llvm::APSInt Left; - if (lex->isIntegerConstantExpr(Left, Context)) { - if (Left == 0 && Right != 0) - Diag(Loc, diag::warn_op_no_effect) - << lex->getSourceRange() << rex->getSourceRange(); - } - if (isCompAssign && Right == 0) - Diag(Loc, diag::warn_op_no_effect) << rex->getSourceRange(); - else if (Right.isNegative()) + if (Right.isNegative()) Diag(Loc, diag::warn_shift_negative) << rex->getSourceRange(); else { llvm::APInt LeftBits(Right.getBitWidth(), |