mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] compilations that do not enable C++ interoperability should not be able to import modules that do enable C++ interoperability by default
A supplemental hidden frontend option allows advanced users to opt-out of this requirement. Fixes https://github.com/apple/swift/issues/65833 Fixes https://github.com/apple/swift/issues/65832
This commit is contained in:
@@ -1319,6 +1319,9 @@ ModuleDecl *CompilerInstance::getMainModule() const {
|
||||
MainModule->setResilienceStrategy(ResilienceStrategy::Resilient);
|
||||
if (Invocation.getLangOptions().isSwiftVersionAtLeast(6))
|
||||
MainModule->setIsConcurrencyChecked(true);
|
||||
if (Invocation.getLangOptions().EnableCXXInterop &&
|
||||
Invocation.getLangOptions().RequireCxxInteropToImportCxxInteropModule)
|
||||
MainModule->setHasCxxInteroperability();
|
||||
|
||||
// Register the main module with the AST context.
|
||||
Context->addLoadedModule(MainModule);
|
||||
|
||||
Reference in New Issue
Block a user