File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -7138,10 +7138,12 @@ def warn_consecutive_comparison : Warning<
71387138 "chained comparison 'X %0 Y %1 Z' does not behave the same as a mathematical expression">,
71397139 InGroup<Parentheses>, DefaultError;
71407140
7141- def warn_comparison_in_fold_expression : Warning<
7142- "comparison in a fold expression would evaluate to '(X %0 Y) %0 Z' "
7143- "which does not behave the same as a mathematical expression">,
7144- InGroup<Parentheses>, DefaultError;
7141+ def warn_comparison_in_fold_expression
7142+ : Warning<
7143+ "comparison in a fold expression would evaluate to '(X %0 Y) %0 Z' "
7144+ "which does not behave the same as a mathematical expression">,
7145+ InGroup<Parentheses>,
7146+ DefaultError;
71457147
71467148def warn_enum_constant_in_bool_context : Warning<
71477149 "converting the enum constant to a boolean">,
Original file line number Diff line number Diff line change @@ -16440,12 +16440,14 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
1644016440 } else {
1644116441 Result = getDerived().RebuildBinaryOperator(E->getEllipsisLoc(),
1644216442 E->getOperator(), LHS, RHS);
16443- if(!WarnedOnComparison && Result.isUsable()) {
16444- if(auto * BO = dyn_cast<BinaryOperator>(Result.get()); BO && BO->isComparisonOp()) {
16445- WarnedOnComparison = true;
16446- SemaRef.Diag(BO->getBeginLoc(), diag::warn_comparison_in_fold_expression)
16447- << BO->getOpcodeStr();
16448- }
16443+ if (!WarnedOnComparison && Result.isUsable()) {
16444+ if (auto *BO = dyn_cast<BinaryOperator>(Result.get());
16445+ BO && BO->isComparisonOp()) {
16446+ WarnedOnComparison = true;
16447+ SemaRef.Diag(BO->getBeginLoc(),
16448+ diag::warn_comparison_in_fold_expression)
16449+ << BO->getOpcodeStr();
16450+ }
1644916451 }
1645016452 }
1645116453 } else
You can’t perform that action at this time.
0 commit comments