mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
The swift/bridging header provides annotation macros (e.g., SWIFT_SHARED_REFERENCE, SWIFT_COMPUTED_PROPERTY) for C++ code that interoperate with Swift. Previously, this header was shipped in the Swift toolchain's usr/include, which is not part of Clang's default search paths in the OSS toolchain, which forced users to manually pass -I flags to find the header. By placing it in Clang's resource directory, the header is automatically discoverable by both clang and swift (via its embedded Clang instance), since both already search <clang-resource-dir>/include by default. In addition to removing lib/ClangImporter/SwiftBridging/, where the swift/bridging lived, this patch also removes build settings related to the bridging header (SWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER and the --enable-cxx-interop-swift-bridging-header build-script flag), as well as the explicit -I flags in interop tests pointing to the old SwiftBridging directory. rdar://136716355
8 lines
244 B
Swift
8 lines
244 B
Swift
// RUN: %target-swift-frontend -typecheck -verify -I %S/Inputs %s -cxx-interoperability-mode=default -disable-availability-checking
|
|
|
|
import VirtMethodWithRvalRef
|
|
|
|
func f(_ x: CxxForeignRef, _ y: NonTrivial) {
|
|
x.takesRValRef(consuming: y)
|
|
}
|