summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-06-03 07:07:00 +0000
committerNico Weber <nicolasweber@gmx.de>2012-06-03 07:07:00 +0000
commitcdfb1ae7f793ebe733330a74e525345bf30c9cc4 (patch)
tree19a66b4aa33b11f473de6a64d94198d19c5838b8 /clang/lib/Sema/SemaExpr.cpp
parent5097e4f38a747061045575f246e9500ef6b75871 (diff)
downloadbcm5719-llvm-cdfb1ae7f793ebe733330a74e525345bf30c9cc4.tar.gz
bcm5719-llvm-cdfb1ae7f793ebe733330a74e525345bf30c9cc4.zip
Improve fixit for comparison operator on lhs of bitwise operator.
Before: test.cc:2:18: note: place parentheses around the == expression to silence this warning if (0 == flags & 0xdd) ^ ( ) Now: test.cc:2:18: note: place parentheses around the == expression to silence this warning if (0 == flags & 0xdd) ^ ( ) llvm-svn: 157897
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 17260c29c94..362bafaa408 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -8092,7 +8092,7 @@ static void DiagnoseBitwisePrecedence(Sema &Self, BinaryOperatorKind Opc,
<< DiagRange << BinOp::getOpcodeStr(Opc) << OpStr;
SuggestParentheses(Self, OpLoc,
Self.PDiag(diag::note_precedence_bitwise_silence) << OpStr,
- RHSExpr->getSourceRange());
+ (isLeftComp ? LHSExpr : RHSExpr)->getSourceRange());
SuggestParentheses(Self, OpLoc,
Self.PDiag(diag::note_precedence_bitwise_first) << BinOp::getOpcodeStr(Opc),
ParensRange);
OpenPOWER on IntegriCloud