Skip to content

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

@hyp

Description

@hyp

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

Metadata

Metadata

Assignees

Labels

bugswift 5.9This PR targets the 5.9 branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions