-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
If module A
enables Swift-Cxx interoperability, module B
does not enable Swift-Cxx interoperability, and B
imports A
, then the compiler emits the error message:
Module 'A' was built with C++ interoperability enabled, but current compilation does not enable C++ interoperability
.
But, if A
imports CxxStdlib
, the error message becomes harder to understand and resolve:
<unknown>:0: error: cannot load underlying module for 'CxxStdlib'
Reproduction
// A.swift, Swift-Cxx interop enabled
import Foundation
import CxxStdlib
// B.swift, Swift-Cxx interop disabled
import A
Expected behavior
I expected that the compiler would emit the error Module 'A' was built with C++ interoperability enabled, but current compilation does not enable C++ interoperability
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Additional information
rdar://139033386
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels