Files
swift-mirror/test/Interop/Cxx/foreign-reference/reference-in-virtual-methods.swift
John Hui e39632ff37 [cxx-interop] Move swift/bridging header to clang resource dir
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
2026-06-08 00:36:11 -07:00

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)
}