mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] Always instantiate the default destructor
This fixes a linker error when using `std::function` from Swift. rdar://103979602
This commit is contained in:
@@ -263,6 +263,10 @@ void IRGenModule::emitClangDecl(const clang::Decl *decl) {
|
||||
// Unfortunately, implicitly defined CXXDestructorDecls don't have a real
|
||||
// body, so we need to traverse these manually.
|
||||
if (auto *dtor = dyn_cast<clang::CXXDestructorDecl>(next)) {
|
||||
if (dtor->isImplicit() && dtor->isDefaulted() && !dtor->isDeleted() &&
|
||||
!dtor->doesThisDeclarationHaveABody())
|
||||
clangSema.DefineImplicitDestructor(dtor->getLocation(), dtor);
|
||||
|
||||
if (dtor->isImplicit() || dtor->hasBody()) {
|
||||
auto cxxRecord = dtor->getParent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user