Skip to content

🍒[cxx-interop] Always instantiate the default destructor #74934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Jul 3, 2024

Explanation: This fixes a linker error when using std::function from Swift. In libc++ std::function inherits from std::__function::__func, which doesn't explicitly define a destructor but inherits from std::__function::__base which defines a virtual destructor.
Scope: Changes IRGen of destructors of C++ structs.
Risk: Low, only affects C++ types.
Testing: Added a compiler test.
Issue: rdar://124061505

This fixes a linker error when using `std::function` from Swift.

rdar://103979602
(cherry picked from commit f56fa41)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jul 3, 2024
This is a follow-up to f56fa41.

rdar://124061505
(cherry picked from commit 34c796d)
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan marked this pull request as ready for review July 5, 2024 12:04
@egorzhdan egorzhdan requested a review from a team as a code owner July 5, 2024 12:04
@egorzhdan egorzhdan enabled auto-merge July 5, 2024 17:01
@egorzhdan egorzhdan merged commit 70342ea into release/6.0 Jul 5, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/6.0-irgen-default-dtor branch July 5, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants