Skip to content

Commit b73adbe

Browse files
committed
Driver: Actually pass -require-explicit-availability{,-target} to frontend jobs
Unless you do this, the flag has no effect when used with the driver; it only worked in conjunction with -Xfrontend. Noticed while working on <rdar://problem/58490723>.
1 parent 3abf47a commit b73adbe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ static void addCommonFrontendArgs(const ToolChain &TC, const OutputInfo &OI,
192192
inputArgs.AddLastArg(arguments, options::OPT_typo_correction_limit);
193193
inputArgs.AddLastArg(arguments, options::OPT_enable_app_extension);
194194
inputArgs.AddLastArg(arguments, options::OPT_enable_library_evolution);
195+
inputArgs.AddLastArg(arguments, options::OPT_require_explicit_availability);
196+
inputArgs.AddLastArg(arguments, options::OPT_require_explicit_availability_target);
195197
inputArgs.AddLastArg(arguments, options::OPT_enable_testing);
196198
inputArgs.AddLastArg(arguments, options::OPT_enable_private_imports);
197199
inputArgs.AddLastArg(arguments, options::OPT_enable_cxx_interop);

test/attr/require_explicit_availability.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %swift -typecheck -parse-stdlib -target x86_64-apple-macosx10.10 -verify -require-explicit-availability -require-explicit-availability-target "macOS 10.10" %s
2-
// RUN: %swift -typecheck -parse-stdlib -target x86_64-apple-macosx10.10 -warnings-as-errors %s
1+
// RUN: %swiftc_driver -typecheck -parse-stdlib -target x86_64-apple-macosx10.10 -Xfrontend -verify -require-explicit-availability -require-explicit-availability-target "macOS 10.10" %s
2+
// RUN: %swiftc_driver -typecheck -parse-stdlib -target x86_64-apple-macosx10.10 -warnings-as-errors %s
33

44
public struct S { // expected-warning {{public declarations should have an availability attribute when building with -require-explicit-availability}}
55
public func method() { }

0 commit comments

Comments
 (0)