================ @@ -15609,6 +15609,14 @@ TreeTransform<Derived>::TransformCXXFoldExpr(CXXFoldExpr *E) { return true; } + // When there's only one expansion, the parentheses can be safely eliminated + // to avoid any extra redundancy that may result in incorrect checks. + // For example, transforming (((args == 0) || ...)) into (args == 0) + // allows the omission of parentheses while ensuring precise representation + // and avoiding warnings regarding redundant parentheses. + if (*NumExpansions == 1 && !E->isTypeDependent()) ---------------- a-tarasyuk wrote:
Since it's only known to occur with fold expressions, should it just be a bool, or would it be better to use an enum? https://github.com/llvm/llvm-project/pull/110761 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits