Skip to content

[interop] do not synthesize special members for C++ records with inco… #68478

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 1 commit into from
Sep 15, 2023

Conversation

hyp
Copy link
Contributor

@hyp hyp commented Sep 12, 2023

…mplete fields

The incomplete fields will trigger different assertions when clang is sythensizing constructors/destructors

rdar://109417079
(cherry picked from commit 786c78a)

Explanation: LLDB during debugging Swift code with enabled C++ interop can sometimes import a type that contains a field with an incomplete type. This leads to crashes in Clang when it tries to check if it can generate a destructor/copy constructor. This change adds a check to the clang importer to avoid generating special members like destructors and copy constructors when importing types with incomplete fields.
Issue: rdar://109417079
Risk: Low, this does not reproduce in compiled code.
Testing: Modified existing unit tests, verified no regressions in unit tests and some adopters, verified LLDB issue resolved.
Reviewer: @zoecarver
Original PR: #68383

…mplete fields

The incomplete fields will trigger different assertions when clang is sythensizing constructors/destructors

rdar://109417079
(cherry picked from commit 786c78a)
@hyp hyp added c++ interop Feature: Interoperability with C++ swift 5.10 labels Sep 12, 2023
@hyp
Copy link
Contributor Author

hyp commented Sep 12, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented Sep 12, 2023

@swift-ci please test source compatibility

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@hyp hyp merged commit 6f5cb90 into swiftlang:release/5.10 Sep 15, 2023
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++ swift 5.10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants