mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Warn on uses of deprecated APIs
Emit a warning when the developer uses an API that has been marked deprecated with an availability attribute. Following the Clang behavior, we will only warn if the API is deprecated on all deployment targets. For example, if an API is deprecated as of OS X 10.11 but the minimum deployment target is 10.10 then no warning will be emitted. rdar://problem/17406050 Swift SVN r25288
This commit is contained in:
@@ -1900,6 +1900,14 @@ NOTE(availability_obsoleted, sema_avail, none,
|
||||
"%0 was obsoleted in %1 version %2",
|
||||
(DeclName, StringRef, clang::VersionTuple))
|
||||
|
||||
WARNING(availability_deprecated, sema_avail, none,
|
||||
"%0 was deprecated in %1 version %2",
|
||||
(DeclName, StringRef, clang::VersionTuple))
|
||||
|
||||
WARNING(availability_deprecated_msg, sema_avail, none,
|
||||
"%0 was deprecated in %1 version %2: %3",
|
||||
(DeclName, StringRef, clang::VersionTuple, StringRef))
|
||||
|
||||
ERROR(availability_decl_only_version_greater, sema_avail, none,
|
||||
"%0 is only available on %1 version %2 or greater",
|
||||
(DeclName, StringRef, clang::VersionTuple))
|
||||
|
||||
Reference in New Issue
Block a user