[cfe-commits] r133526 - /cfe/trunk/lib/Sema/SemaExpr.cpp
Chandler Carruth
chandlerc at gmail.com
Tue Jun 21 11:07:33 PDT 2011
Author: chandlerc
Date: Tue Jun 21 13:07:33 2011
New Revision: 133526
URL: http://llvm.org/viewvc/llvm-project?rev=133526&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=133526&r1=133525&r2=133526&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Jun 21 13:07:33 2011
@@ -6377,13 +6377,13 @@
<< 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
More information about the cfe-commits
mailing list