Skip to content

Commit aed5614

Browse files
committed
[cxx-interop] Explicitly disable -fmodules-local-submodule-visibility
Clang implicitly enables local submodule visibility when compiling in C++20 mode. ClangImporter does not support it, so let's disable it explicitly. rdar://108959307 / #65710
1 parent 9a496e8 commit aed5614

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: lib/ClangImporter/ClangImporter.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,9 @@ ClangImporter::create(ASTContext &ctx,
12551255
// read them later.
12561256
instance.getLangOpts().NeededByPCHOrCompilationUsesPCH = true;
12571257

1258+
// Clang implicitly enables this by default in C++20 mode.
1259+
instance.getLangOpts().ModulesLocalVisibility = false;
1260+
12581261
if (importerOpts.Mode == ClangImporterOptions::Modes::PrecompiledModule)
12591262
return importer;
12601263

Diff for: test/Interop/Cxx/concepts/method-requires.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-swiftxx-frontend -emit-ir -Xcc -std=gnu++20 -I %S/Inputs %s | %FileCheck %s
22
//
3-
// REQUIRES: OS=macosx
3+
// REQUIRES: OS=macosx || OS=linux-gnu
44

55
import MethodRequires
66

Diff for: test/Interop/Cxx/stdlib/use-std-vector.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
2-
// FIXME: also test this in C++20 mode once rdar://108810356 is fixed.
2+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -std=gnu++20)
33
//
44
// REQUIRES: executable_test
55
//

0 commit comments

Comments
 (0)