Skip to content

Commit 2affbd8

Browse files
authored
Merge pull request #76665 from tshortli/stdlib-enable-member-import-visibility
stdlib: Enable upcoming `MemberImportVisibility` feature
2 parents 872f242 + c9c3673 commit 2affbd8

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
270270
inputArgs.AddLastArg(arguments, options::OPT_disable_dynamic_actor_isolation);
271271
inputArgs.AddLastArg(arguments, options::OPT_warn_concurrency);
272272
inputArgs.AddLastArg(arguments, options::OPT_strict_concurrency);
273-
inputArgs.AddAllArgs(arguments, options::OPT_enable_experimental_feature);
274-
inputArgs.AddAllArgs(arguments, options::OPT_enable_upcoming_feature);
273+
inputArgs.addAllArgs(arguments, {options::OPT_enable_experimental_feature,
274+
options::OPT_disable_experimental_feature,
275+
options::OPT_enable_upcoming_feature,
276+
options::OPT_disable_upcoming_feature});
275277
inputArgs.AddLastArg(arguments, options::OPT_warn_implicit_overrides);
276278
inputArgs.AddLastArg(arguments, options::OPT_typo_correction_limit);
277279
inputArgs.AddLastArg(arguments, options::OPT_enable_app_extension);

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,8 @@ function(_compile_swift_files
633633
list(APPEND swift_flags "-enable-experimental-feature" "SuppressedAssociatedTypes")
634634
list(APPEND swift_flags "-enable-experimental-feature" "SE427NoInferenceOnExtension")
635635
list(APPEND swift_flags "-enable-experimental-feature" "AllowUnsafeAttribute")
636-
637636
list(APPEND swift_flags "-enable-experimental-feature" "NonescapableTypes")
638-
639-
list(APPEND swift_flags "-enable-experimental-feature" "ExtensionImportVisiblity")
637+
list(APPEND swift_flags "-enable-upcoming-feature" "MemberImportVisibility")
640638

641639
if (SWIFT_STDLIB_ENABLE_STRICT_CONCURRENCY_COMPLETE)
642640
list(APPEND swift_flags "-strict-concurrency=complete")

stdlib/public/Cxx/std/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_O
5252
-Xfrontend -module-interface-preserve-types-as-written
5353
-enable-experimental-feature AssumeResilientCxxTypes
5454

55+
# The varying modularization of the C++ standard library on different
56+
# platforms makes it difficult to enable MemberImportVisibility for this
57+
# module
58+
-disable-upcoming-feature MemberImportVisibility
59+
5560
SWIFT_COMPILE_FLAGS_LINUX
5661
${SWIFT_SDK_LINUX_CXX_OVERLAY_SWIFT_COMPILE_FLAGS}
5762

test/Driver/features.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %swiftc_driver -emit-executable -o %t.exe %s \
2+
// RUN: -enable-upcoming-feature MemberImportVisibility \
3+
// RUN: -enable-experimental-feature ParserValidation \
4+
// RUN: -disable-upcoming-feature MemberImportVisibility \
5+
// RUN: -disable-experimental-feature ParserValidation \
6+
// RUN: -disallow-use-new-driver -driver-print-jobs 2>&1 | %FileCheck %s
7+
8+
// The new driver has its own test for this
9+
10+
// REQUIRES: cplusplus_driver
11+
// REQUIRES: swift_feature_ParserValidation
12+
// REQUIRES: swift_feature_MemberImportVisibility
13+
14+
// CHECK: {{.*}}swift{{c|-frontend}}{{(.exe)?"?}} -frontend
15+
// CHECK-SAME: -enable-upcoming-feature MemberImportVisibility
16+
// CHECK-SAME: -enable-experimental-feature ParserValidation
17+
// CHECK-SAME: -disable-upcoming-feature MemberImportVisibility
18+
// CHECK-SAME: -disable-experimental-feature ParserValidation

0 commit comments

Comments
 (0)