[clang] [Clang] omit parentheses in fold expressions with a single expansion (PR #110761)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 16:32:48 PDT 2024


================
@@ -15598,6 +15598,9 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) {
     return getDerived().RebuildEmptyCXXFoldExpr(E->getEllipsisLoc(),
                                                 E->getOperator());
 
+  if (*NumExpansions == 1)
----------------
a-tarasyuk wrote:

@erichkeane thanks for the detailed feedback! I’ve added more tests and adjusted the ignore parentheses to apply to the pattern. Are there any other cases that should be covered?

https://github.com/llvm/llvm-project/pull/110761


More information about the cfe-commits mailing list