[5.9][interop][SwiftToCxx] avoid importing C++ stdlib in C++ section of ge… #65753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…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