================ @@ -1798,6 +1798,62 @@ class DeferredDiagnosticsEmitter Inherited::visitUsedDecl(Loc, D); } + // Visitor member and parent dtors called by this dtor. + void VisitCalledDestructors(CXXDestructorDecl *DD) { + const CXXRecordDecl *RD = DD->getParent(); + + // Visit the dtors of all members + for (const FieldDecl *FD : RD->fields()) { + QualType FT = FD->getType(); + if (const auto *RT = FT->getAs<RecordType>()) { + if (const auto *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) { + if (ClassDecl->hasDefinition()) { + if (CXXDestructorDecl *MemberDtor = ClassDecl->getDestructor()) { + asImpl().visitUsedDecl(MemberDtor->getLocation(), MemberDtor); + } + } + } + } ---------------- Artem-B wrote:
These do not need `{}`. We do not have any else clauses here, so even with deep nesting it would work fine. https://github.com/llvm/llvm-project/pull/129117 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits