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)
^
( )
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157897
91177308-0d34-0410-b5e6-
96231b3b80d8
<< 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);
{
if (0 & 1 == 1)
{}
+
+ if (1 == 0 & 1)
+ {}
}
// CHECK-3: {{^ }}if (0 & 1 == 1)
// CHECK-3: {{^ }} ( )
+// CHECK-3: {{^ }}if (1 == 0 & 1)
+// CHECK-3: {{^ }} ( )
// CHECK-4: {{^ }}if (0 & 1 == 1)
// CHECK-4: {{^ }} ( )
+// CHECK-4: {{^ }}if (1 == 0 & 1)
+// CHECK-4: {{^ }} ( )
// CHECK-5: {{^ }}if (0 & 1 == 1)
// CHECK-5: {{^ }} ( )
+// CHECK-5: {{^ }}if (1 == 0 & 1)
+// CHECK-5: {{^ }} ( )