Skip to content

[cxx-interop] Make automatic conformances work with the bridging header #71243

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
Feb 1, 2024

Conversation

egorzhdan
Copy link
Contributor

For C++ types that are defined in the bridging header, or are #include-d from the bridging header, we did not generate the automatic conformances to CxxSequence, CxxRandomAccessCollection protocols.

To check whether we should try to conform a C++ type to those protocols, the compiler checks for the presence of requires cplusplus in the module declaration in a modulemap file. This check is there to prevent us from accidentally pulling in Cxx/CxxStdlib modules when a client is importing a C library.

This change makes sure those conformances are generated.

rdar://121927459

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jan 30, 2024
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/std-vector-bridging-header branch from 5fc27fe to 5c5e993 Compare January 30, 2024 18:56
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

For C++ types that are defined in the bridging header, or are `#include`-d from the bridging header, we did not generate the automatic conformances to `CxxSequence`, `CxxRandomAccessCollection` protocols.

To check whether we should try to conform a C++ type to those protocols, the compiler checks for the presence of `requires cplusplus` in the module declaration in a modulemap file. This check is there to prevent us from accidentally pulling in `Cxx`/`CxxStdlib` modules when a client is importing a C library.

This change makes sure those conformances are generated.

rdar://121927459
@egorzhdan egorzhdan force-pushed the egorzhdan/std-vector-bridging-header branch from 5c5e993 to c26fe86 Compare January 31, 2024 13:56
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit db424e2 into main Feb 1, 2024
@egorzhdan egorzhdan deleted the egorzhdan/std-vector-bridging-header branch February 1, 2024 13:14
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.

1 participant