Skip to content

🍒[cxx-interop][SwiftToCxx] Emit foreign reference types with * in the generated Clang header #68241

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 1, 2023

Conversation

egorzhdan
Copy link
Contributor

C++ foreign reference types are imported to Swift as classes, not structs. When generating a Clang header that represents a Swift struct holding a C++ FRT as a field, we need to print the FRT as a pointer.

This was previously hitting an assertion in debug builds of the compiler: assert(CD->isObjC()).

Original PR: #68237

rdar://114711899
(cherry picked from commit c45753d)

…e generated Clang header

C++ foreign reference types are imported to Swift as classes, not structs. When generating a Clang header that represents a Swift struct holding a C++ FRT as a field, we need to print the FRT as a pointer.

This was previously hitting an assertion in debug builds of the compiler: `assert(CD->isObjC())`.

rdar://114711899
(cherry picked from commit c45753d)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Aug 31, 2023
@egorzhdan egorzhdan requested a review from a team as a code owner August 31, 2023 16:21
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@DougGregor DougGregor merged commit ad68bf3 into release/5.9 Sep 1, 2023
@DougGregor DougGregor deleted the egorzhdan/5.9-cxx-to-swift-to-objcxx branch September 1, 2023 19:34
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