Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[6.4] [cxx-interop] Guard Span-referencing declarations in Cxx module interface behind version check#89195

Open
patrykstefanski wants to merge 1 commit into
swiftlang:release/6.4.xfrom
patrykstefanski:add-guards-for-swift-span-6-4
Open

[6.4] [cxx-interop] Guard Span-referencing declarations in Cxx module interface behind version check#89195
patrykstefanski wants to merge 1 commit into
swiftlang:release/6.4.xfrom
patrykstefanski:add-guards-for-swift-span-6-4

Conversation

@patrykstefanski
Copy link
Copy Markdown
Contributor

When a newer toolchain (Swift >=6.2) is used with an older SDK whose stdlib predates Swift 6.2, the Cxx module interface references Swift.Span and Swift.MutableSpan which don't exist in the older stdlib, causing build failures.

Guard individual declarations in the Cxx overlay that reference Span/MutableSpan behind #if canImport(Swift, _version: 6.2). The guard wraps (rather than replaces) existing feature-based guards like $LifetimeDependence, so both compiler capability and stdlib availability are checked.

rdar://176312542

(cherry picked from commit 9e057e5)

TODO: Fill template

…face behind version check

When a newer toolchain (Swift >=6.2) is used with an older SDK whose
stdlib predates Swift 6.2, the Cxx module interface references
`Swift.Span` and `Swift.MutableSpan` which don't exist in the older
stdlib, causing build failures.

Guard individual declarations in the Cxx overlay that reference
`Span`/`MutableSpan` behind `#if canImport(Swift, _version: 6.2)`. The
guard wraps (rather than replaces) existing feature-based guards like
`$LifetimeDependence`, so both compiler capability and stdlib
availability are checked.

rdar://176312542

(cherry picked from commit 9e057e5)
@patrykstefanski patrykstefanski requested a review from a team as a code owner May 16, 2026 19:06
@patrykstefanski patrykstefanski added the c++ interop Feature: Interoperability with C++ label May 16, 2026
@patrykstefanski
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

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