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:
@@ -181,6 +181,9 @@ static bool readOptionsBlock(llvm::BitstreamCursor &cursor,
|
||||
case options_block::MODULE_EXPORT_AS_NAME:
|
||||
extendedInfo.setExportAsName(blobData);
|
||||
break;
|
||||
case options_block::HAS_CXX_INTEROPERABILITY_ENABLED:
|
||||
extendedInfo.setHasCxxInteroperability(true);
|
||||
break;
|
||||
default:
|
||||
// Unknown options record, possibly for use by a future version of the
|
||||
// module format.
|
||||
@@ -1378,6 +1381,7 @@ ModuleFileSharedCore::ModuleFileSharedCore(
|
||||
Bits.IsAllowModuleWithCompilerErrorsEnabled =
|
||||
extInfo.isAllowModuleWithCompilerErrorsEnabled();
|
||||
Bits.IsConcurrencyChecked = extInfo.isConcurrencyChecked();
|
||||
Bits.HasCxxInteroperability = extInfo.hasCxxInteroperability();
|
||||
MiscVersion = info.miscVersion;
|
||||
ModuleABIName = extInfo.getModuleABIName();
|
||||
ModulePackageName = extInfo.getModulePackageName();
|
||||
|
||||
Reference in New Issue
Block a user