forked from OSchip/llvm-project
Switch the order of the notes for the parentheses suggested in the case
of: a + b ? x : y. In our testing of this flag we've yet to hit a single case where the existing precedence was correct, so we should suggest grouping the ?: first. llvm-svn: 133526
This commit is contained in:
parent
7887637c82
commit
fc8a0fbeed
|
@ -6376,14 +6376,14 @@ static void DiagnoseConditionalPrecedence(Sema &Self,
|
|||
<< Condition->getSourceRange()
|
||||
<< BinaryOperator::getOpcodeStr(CondOpcode);
|
||||
|
||||
SuggestParentheses(Self, OpLoc,
|
||||
Self.PDiag(diag::note_precedence_conditional_first),
|
||||
SourceRange(CondRHS->getLocStart(), RHS->getLocEnd()));
|
||||
|
||||
SuggestParentheses(Self, OpLoc,
|
||||
Self.PDiag(diag::note_precedence_conditional_silence)
|
||||
<< BinaryOperator::getOpcodeStr(CondOpcode),
|
||||
SourceRange(Condition->getLocStart(), Condition->getLocEnd()));
|
||||
|
||||
SuggestParentheses(Self, OpLoc,
|
||||
Self.PDiag(diag::note_precedence_conditional_first),
|
||||
SourceRange(CondRHS->getLocStart(), RHS->getLocEnd()));
|
||||
}
|
||||
|
||||
/// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
|
||||
|
|
Loading…
Reference in New Issue