[clang] [CIR] Implement cleanup handling for destructor ILE initializers (PR #192172)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 15 06:58:53 PDT 2026


================
@@ -1189,10 +1189,14 @@ void AggExprEmitter::visitCXXParenListOrInitListExpr(
     // Push a destructor if necessary.
     // FIXME: if we have an array of structures, all explicitly
     // initialized, we can end up pushing a linear number of cleanups.
-    if (field->getType().isDestructedType()) {
-      cgf.cgm.errorNYI(e->getSourceRange(),
-                       "visitCXXParenListOrInitListExpr destructor");
-      return;
+    if (QualType::DestructionKind dtorKind =
+            field->getType().isDestructedType()) {
+      assert(lv.isSimple());
+      if (dtorKind) {
----------------
erichkeane wrote:

This 'if' doesn't make sense, right?  Since you're already checking if `dtorKind` is true? 

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


More information about the cfe-commits mailing list