diff options
Diffstat (limited to 'clang/lib/Sema/SemaTemplateVariadic.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateVariadic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateVariadic.cpp b/clang/lib/Sema/SemaTemplateVariadic.cpp index b6bd6c03ff9..c278639073b 100644 --- a/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -998,7 +998,9 @@ static void CheckFoldOperand(Sema &S, Expr *E) { return; E = E->IgnoreImpCasts(); - if (isa<BinaryOperator>(E) || isa<AbstractConditionalOperator>(E)) { + auto *OCE = dyn_cast<CXXOperatorCallExpr>(E); + if ((OCE && OCE->isInfixBinaryOp()) || isa<BinaryOperator>(E) || + isa<AbstractConditionalOperator>(E)) { S.Diag(E->getExprLoc(), diag::err_fold_expression_bad_operand) << E->getSourceRange() << FixItHint::CreateInsertion(E->getLocStart(), "(") |

