Skip to content

[5.9][interop][SwiftToCxx] avoid importing C++ stdlib in C++ section of ge… #65753

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

Conversation

hyp
Copy link
Contributor

@hyp hyp commented May 8, 2023

…nerated header inside of 'pragma clang attribute' block

Explanation: The C++ section of the generated header was emitted inside of #pragma clang attribute push #pragma clang attribute external_source_symbol (...) directive block, which meant that some C++ standard library headers included within the stdlib overlay in the C++ section of the generated header were affected by the pragma, which was wrong. This pragma is only meant for the ObjC section of the header, so this change ends the scope of the directive before the C++ section starts.
Scope: Swift's and C/ObjC/C++ interoperability, generated header printer.
Risk: Low. Even though this affects generated header in C/ObjC mode, this change only moves the location of the emitted #pragma clang attribute pop but doesn't introduce anything new into the generated header.
Testing: Swift unit tests, manual testing on some adopter projects and several Swift packages that import C.
PR: #65680

…nerated header inside of 'pragma clang attribute' block
@hyp hyp added c++ interop Feature: Interoperability with C++ swift 5.9 labels May 8, 2023
@hyp hyp requested a review from a team as a code owner May 8, 2023 05:45
@hyp hyp changed the title [interop][SwiftToCxx] avoid importing C++ stdlib in C++ section of ge… [5.9][interop][SwiftToCxx] avoid importing C++ stdlib in C++ section of ge… May 8, 2023
@hyp
Copy link
Contributor Author

hyp commented May 8, 2023

@swift-ci please test

@hyp
Copy link
Contributor Author

hyp commented May 8, 2023

@swift-ci please test source compatibility

@hyp hyp merged commit ec192f6 into swiftlang:release/5.9 May 8, 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.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants