================
@@ -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())
----------------
erichkeane wrote:

I like doing enums, only because they are more descriptive, so I'd suggest one 
of those, but of size `uint8_t` on `ParenExpr`.  If we decide to add a 
different 'origin' later, that might be useful.

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

Reply via email to