summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorRyan Flynn <pizza@parseerror.com>2009-08-08 19:18:23 +0000
committerRyan Flynn <pizza@parseerror.com>2009-08-08 19:18:23 +0000
commit2f08571e4d52d0d535532468cd3210fecb81de13 (patch)
tree8cf26d2117a7032a4fd950e551214dc92e655395 /clang/lib/Sema/SemaExpr.cpp
parent16cf1967f5ef12efd0c7db302d87f6e7d9071bf9 (diff)
downloadbcm5719-llvm-2f08571e4d52d0d535532468cd3210fecb81de13.tar.gz
bcm5719-llvm-2f08571e4d52d0d535532468cd3210fecb81de13.zip
PR4700 - remove shift by 0 warning
llvm-svn: 78488
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index cec1aeafac5..f00ab5412d3 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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(),
OpenPOWER on IntegriCloud