Commit Graph

21 Commits

Author SHA1 Message Date
Allan Shortlidge
50835e8590 Basic: Add minimum availability version for visionOS.
This fixes an issue where diagnostics were not emitted for missing availability
attributes when compiling for visionOS.

Resolves rdar://127073463
2024-04-25 15:10:51 -07:00
Anthony Latsis
14b70f306b DiagnosticVerifier: Default expected fix-it start line to the diagnostic's 2023-03-08 12:10:27 +03:00
Alexis Laferrière
7a7f3ac52f [Sema] Enable require explicit availability by default for public modules
rdar://99929744
2022-09-19 09:04:44 -07:00
Alexis Laferrière
a92e607f77 Revert "[Sema] Enable require explicit availability by default for public modules"
This reverts commit 2175e4e27d.
2022-09-16 09:50:12 -07:00
Alexis Laferrière
2175e4e27d [Sema] Enable require explicit availability by default for public modules
rdar://99929744
2022-09-14 16:21:52 -07:00
Alexis Laferrière
dcbef35982 [Sema] Intro flag to promote to an error missing explicit availability 2022-09-14 16:21:52 -07:00
Alexis Laferrière
8f256ad297 [Sema] Update diagnostic for required availability 2022-09-14 10:36:24 -07:00
Allan Shortlidge
a3f8cf9251 Sema: When diagnosing required explicit availability, skip members of extensions that have been declared explicitly unavailable. The existing logic only checked for an unavailable attr in the direct attributes of the decl.
Resolves rdar://85429703
2022-04-26 15:39:35 -07:00
Mishal Shah
22f61df98b Use %target-cpu in the tests to support running on Apple Silicon hardware 2021-04-08 23:26:18 -07:00
Alexis Laferrière
8307a8d58e [Sema] Don't require availability for implicit decls
Suppress warnings in synthesized code. The parent decls should already
show a warning.

require_explicit_availability.StructWithImplicitMembers:2:16: warning:
public declarations should have an availability attribute when building
with -require-explicit-availability
    public var hashValue: Int { get }
               ^
2020-10-13 14:50:20 -07:00
Alexis Laferrière
8248020074 [Sema] Require availability for inits and subscripts in extensions 2020-09-10 12:13:15 -07:00
Alexis Laferrière
0d0dd5386e [Sema] Support pattern binding decls with -require-explicit-availability 2020-09-10 11:55:24 -07:00
Alexis Laferrière
ad7afe43d1 [Sema] @_spi decls don't require an availability attribute 2020-09-10 10:48:06 -07:00
Alexis Laferrière
3bb4f11486 [Sema] Fix detection of required availability attributes on extensions 2020-09-10 10:48:06 -07:00
Doug Gregor
030392a89f [Test] Run macOS-specific test only on macOS 2020-06-16 12:36:12 -07:00
Alexis Laferrière
e1d13b8edc [Sema] Don't warn for availability of extensions with no public members
rdar://problem/61879659
2020-04-17 11:23:09 -07:00
Slava Pestov
b73adbe700 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>.
2020-01-13 21:50:10 -05:00
Slava Pestov
3abf47a191 Sema: Improve -require-explicit-availability diagnostic phrasing 2020-01-13 21:49:51 -05:00
Alexis Laferrière
c84e9df307 Frontend: -require-explicit-availability should not warn if marked unavailable 2019-08-14 13:01:07 -07:00
Ben Langmuir
0f0ad8cc0e Attempt to fix attr/require_explicit_availability test on non-mac
There was an unepxected warning because of mixing iOS and mac flags.
2019-06-17 17:21:28 -07:00
Alexis Laferrière
c44cff7c97 Add a CLI option to warn when a public decl has no availability
Add the command line option -require-explicit-availability to detect public
or `@usableFromInline` declarations and warn if they don't declare
an introduction OS version. This option should catch forgotten `@available`
attributes in frameworks where all services are expected to be introduced
by an OS version.

The option -require-explicit-availability-target "macOS 10.14, iOS 12.0"
can be specified for the compiler to suggest fix-its with the missing
attributes `@available(macOS 10.14, iOS 12.0, *)`.

rdar://51001662
2019-06-17 10:32:58 -07:00