[clang] [CIR] Add complete destructor handling (PR #149552)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 21 00:19:15 PDT 2025


================
@@ -593,11 +593,12 @@ void CIRGenFunction::emitDestructorBody(FunctionArgList &args) {
 
     assert(!cir::MissingFeatures::dtorCleanups());
 
-    // TODO(cir): A complete destructor is supposed to call the base destructor.
-    // Since we have to emit both dtor kinds we just fall through for now and.
-    // As long as we don't support virtual bases this should be functionally
-    // equivalent.
-    assert(!cir::MissingFeatures::completeDtors());
+    if (!isTryBody) {
+      QualType thisTy = dtor->getFunctionObjectParameterType();
+      emitCXXDestructorCall(dtor, Dtor_Base, /*ForVirtualBase=*/false,
+                            /*Delegating=*/false, loadCXXThisAddress(), thisTy);
----------------
xlauko wrote:

```suggestion
                            /*delegating=*/false, loadCXXThisAddress(), thisTy);
```

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


More information about the cfe-commits mailing list