diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-06-21 18:07:33 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-06-21 18:07:33 +0000 |
commit | 1b132906ad580755e501ad0b3862e2d5a34106d1 (patch) | |
tree | 74b13d97200c90328f3d1eafaf652f5a48d1cf29 /lib/Sema/SemaExpr.cpp | |
parent | af9751747b098d77052cb71f1e648f29cfbadcc1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index b830ba4731..3b77871fe4 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -6377,13 +6377,13 @@ static void DiagnoseConditionalPrecedence(Sema &Self, << 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 |