[clang] [clang][win] Define vector deleting dtor body for declared-only dtor if needed (PR #185653)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 09:12:51 PDT 2026


================
@@ -13642,6 +13631,8 @@ bool ASTContext::classNeedsVectorDeletingDestructor(const CXXRecordDecl *RD) {
   if (!getTargetInfo().emitVectorDeletingDtors(getLangOpts()))
     return false;
   CXXDestructorDecl *Dtor = RD->getDestructor();
+  if (!Dtor || !Dtor->isVirtual())
+    return false;
----------------
Fznamznon wrote:

Cleaned up in https://github.com/llvm/llvm-project/pull/185653/commits/c7bbfc3d71f87edbead778b9d79355bc191e413a , thanks.

> This skips the call to RequireVectorDeletingDtor.count()

yeah, before this patch `setClassNeedsVectorDeletingDestructor()` without checking that the class actually needs vector deleting destructor, so at some point I started seeing fails and added this check and forgot to clean up the next check. After that I realized that `setClassNeedsVectorDeletingDestructor()` shouldn't be called if there is no virtual dtor but left this early exit because it makes sense IMO.

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


More information about the cfe-commits mailing list