Skip to content
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

[C++ interop] c++ language standard is not passed to Swift's clang importer when C++ interop is enabled #6565

Closed
Tracked by #65808
hyp opened this issue May 16, 2023 · 0 comments · Fixed by #6649
Closed
Tracked by #65808
Assignees
Labels
bug swift 5.9 This PR targets the 5.9 branch

Comments

@hyp
Copy link
Contributor

hyp commented May 16, 2023

Description

C++ interoperability can be enabled using the new .interoperabilityMode(.Cxx) setting.
Such Swift target should be able to import any C++ headers, e.g. If the user specifies that the package manifest uses C++20 mode then it should be possible to import C++ code that requires C++20. SwiftPM should pass -Xcc -std=c++20 in that case.

Expected behavior

SwiftPM should pass -Xcc -std=c++20 in that case, when a Swift target enables C++ interop, and the package manifest specifies that C++20 is used.

Actual behavior

SwiftPM doesn't pass C++20 language mode to clang importer in Swift.

Steps to reproduce

No response

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

@hyp hyp added bug swift 5.9 This PR targets the 5.9 branch labels May 16, 2023
@hyp hyp self-assigned this May 16, 2023
@hyp hyp changed the title [C++ interop] c++ language standard is not passed to clang imported when C++ interop is enabled [C++ interop] c++ language standard is not passed to Swift's clang importer when C++ interop is enabled May 16, 2023
hyp added a commit to hyp/swift-package-manager that referenced this issue Jun 14, 2023
@hyp hyp closed this as completed in #6649 Jun 14, 2023
hyp added a commit that referenced this issue Jun 14, 2023
hyp added a commit to hyp/swift-package-manager that referenced this issue Jun 14, 2023
…ft when C++ interoperability is enabled (swiftlang#6649)

Fixes swiftlang#6565

(cherry picked from commit cefff2b)
hyp added a commit that referenced this issue Jun 14, 2023
…ft when C++ interoperability is enabled (#6649) (#6652)

Fixes #6565

(cherry picked from commit cefff2b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift 5.9 This PR targets the 5.9 branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant