Files
swift-mirror/test/Interop/Cxx/stdlib/unsupported-stdlib.swift
Egor Zhdan 059f0f97d1 [cxx-interop] Allow compiling with libc++ on Linux
This makes sure that Swift respects `-Xcc -stdlib=libc++` flags.

Clang already has existing logic to discover the system-wide libc++ installation on Linux. We rely on that logic here.

Importing a Swift module that was built with a different C++ stdlib is not supported and emits an error.

The Cxx module can be imported when compiling with any C++ stdlib. The synthesized conformances, e.g. to CxxRandomAccessCollection also work. However, CxxStdlib currently cannot be imported when compiling with libc++, since on Linux it refers to symbols from libstdc++ which have different mangled names in libc++.

rdar://118357548 / https://github.com/swiftlang/swift/issues/69825
2024-08-08 16:24:58 +01:00

7 lines
319 B
Swift

// RUN: not %target-swift-frontend -typecheck -Xcc -stdlib=invalid -cxx-interoperability-mode=default %s 2>&1 | %FileCheck %s
// Windows does not honor `-stdlib=xyz` arguments, so the error message is different on Windows.
// XFAIL: OS=windows-msvc
// CHECK: error: invalid library name in argument '-stdlib=invalid'