diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/ARCMigrate/ARCMT.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/OSTargets.cpp | 72 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/OSTargets.h | 48 | ||||
-rw-r--r-- | clang/lib/Basic/Targets/X86.h | 5 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/Darwin.cpp | 40 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/Linux.cpp | 13 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/MSVC.cpp | 10 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/NetBSD.cpp | 23 | ||||
-rw-r--r-- | clang/test/Sema/attr-availability-android.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/attr-availability.c | 10 | ||||
-rw-r--r-- | clang/test/Sema/availability-guard-format.mm | 2 | ||||
-rw-r--r-- | clang/test/SemaObjC/attr-availability.m | 20 | ||||
-rw-r--r-- | clang/test/SemaObjC/property-deprecated-warning.m | 14 | ||||
-rw-r--r-- | clang/test/SemaObjC/unguarded-availability-maccatalyst.m | 8 | ||||
-rw-r--r-- | clang/test/SemaObjC/unguarded-availability.m | 36 |
15 files changed, 146 insertions, 161 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 4851c43..68ee7c5 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -162,9 +162,7 @@ static bool HasARCRuntime(CompilerInvocation &origCI) { return triple.getOSMajorVersion() >= 11; if (triple.getOS() == llvm::Triple::MacOSX) { - unsigned Major, Minor, Micro; - triple.getOSVersion(Major, Minor, Micro); - return Major > 10 || (Major == 10 && Minor >= 7); + return triple.getOSVersion() >= VersionTuple(10, 7); } return false; diff --git a/clang/lib/Basic/Targets/OSTargets.cpp b/clang/lib/Basic/Targets/OSTargets.cpp index 53748bf..695cbaf 100644 --- a/clang/lib/Basic/Targets/OSTargets.cpp +++ b/clang/lib/Basic/Targets/OSTargets.cpp @@ -48,12 +48,12 @@ void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, Builder.defineMacro("_REENTRANT"); // Get the platform type and version number from the triple. - unsigned Maj, Min, Rev; + VersionTuple OsVersion; if (Triple.isMacOSX()) { - Triple.getMacOSXVersion(Maj, Min, Rev); + Triple.getMacOSXVersion(OsVersion); PlatformName = "macos"; } else { - Triple.getOSVersion(Maj, Min, Rev); + OsVersion = Triple.getOSVersion(); PlatformName = llvm::Triple::getOSTypeName(Triple.getOS()); if (PlatformName == "ios" && Triple.isMacCatalystEnvironment()) PlatformName = "maccatalyst"; @@ -63,29 +63,29 @@ void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, // generating code for Win32 ABI. No need to emit // __ENVIRONMENT_XX_OS_VERSION_MIN_REQUIRED__. if (PlatformName == "win32") { - PlatformMinVersion = VersionTuple(Maj, Min, Rev); + PlatformMinVersion = OsVersion; return; } // Set the appropriate OS version define. if (Triple.isiOS()) { - assert(Maj < 100 && Min < 100 && Rev < 100 && "Invalid version!"); + assert(OsVersion < VersionTuple(100) && "Invalid version!"); char Str[7]; - if (Maj < 10) { - Str[0] = '0' + Maj; - Str[1] = '0' + (Min / 10); - Str[2] = '0' + (Min % 10); - Str[3] = '0' + (Rev / 10); - Str[4] = '0' + (Rev % 10); + if (OsVersion.getMajor() < 10) { + Str[0] = '0' + OsVersion.getMajor(); + Str[1] = '0' + (OsVersion.getMinor().getValueOr(0) / 10); + Str[2] = '0' + (OsVersion.getMinor().getValueOr(0) % 10); + Str[3] = '0' + (OsVersion.getSubminor().getValueOr(0) / 10); + Str[4] = '0' + (OsVersion.getSubminor().getValueOr(0) % 10); Str[5] = '\0'; } else { // Handle versions >= 10. - Str[0] = '0' + (Maj / 10); - Str[1] = '0' + (Maj % 10); - Str[2] = '0' + (Min / 10); - Str[3] = '0' + (Min % 10); - Str[4] = '0' + (Rev / 10); - Str[5] = '0' + (Rev % 10); + Str[0] = '0' + (OsVersion.getMajor() / 10); + Str[1] = '0' + (OsVersion.getMajor() % 10); + Str[2] = '0' + (OsVersion.getMinor().getValueOr(0) / 10); + Str[3] = '0' + (OsVersion.getMinor().getValueOr(0) % 10); + Str[4] = '0' + (OsVersion.getSubminor().getValueOr(0) / 10); + Str[5] = '0' + (OsVersion.getSubminor().getValueOr(0) % 10); Str[6] = '\0'; } if (Triple.isTvOS()) @@ -95,13 +95,13 @@ void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, Str); } else if (Triple.isWatchOS()) { - assert(Maj < 10 && Min < 100 && Rev < 100 && "Invalid version!"); + assert(OsVersion < VersionTuple(10) && "Invalid version!"); char Str[6]; - Str[0] = '0' + Maj; - Str[1] = '0' + (Min / 10); - Str[2] = '0' + (Min % 10); - Str[3] = '0' + (Rev / 10); - Str[4] = '0' + (Rev % 10); + Str[0] = '0' + OsVersion.getMajor(); + Str[1] = '0' + (OsVersion.getMinor().getValueOr(0) / 10); + Str[2] = '0' + (OsVersion.getMinor().getValueOr(0) % 10); + Str[3] = '0' + (OsVersion.getSubminor().getValueOr(0) / 10); + Str[4] = '0' + (OsVersion.getSubminor().getValueOr(0) % 10); Str[5] = '\0'; Builder.defineMacro("__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__", Str); } else if (Triple.isMacOSX()) { @@ -109,22 +109,22 @@ void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, // define (because we only get a single digit for the minor and micro // revision numbers). So, we limit them to the maximum representable // version. - assert(Maj < 100 && Min < 100 && Rev < 100 && "Invalid version!"); + assert(OsVersion < VersionTuple(100) && "Invalid version!"); char Str[7]; - if (Maj < 10 || (Maj == 10 && Min < 10)) { - Str[0] = '0' + (Maj / 10); - Str[1] = '0' + (Maj % 10); - Str[2] = '0' + std::min(Min, 9U); - Str[3] = '0' + std::min(Rev, 9U); + if (OsVersion < VersionTuple(10, 10)) { + Str[0] = '0' + (OsVersion.getMajor() / 10); + Str[1] = '0' + (OsVersion.getMajor() % 10); + Str[2] = '0' + std::min(OsVersion.getMinor().getValueOr(0), 9U); + Str[3] = '0' + std::min(OsVersion.getSubminor().getValueOr(0), 9U); Str[4] = '\0'; } else { // Handle versions > 10.9. - Str[0] = '0' + (Maj / 10); - Str[1] = '0' + (Maj % 10); - Str[2] = '0' + (Min / 10); - Str[3] = '0' + (Min % 10); - Str[4] = '0' + (Rev / 10); - Str[5] = '0' + (Rev % 10); + Str[0] = '0' + (OsVersion.getMajor() / 10); + Str[1] = '0' + (OsVersion.getMajor() % 10); + Str[2] = '0' + (OsVersion.getMinor().getValueOr(0) / 10); + Str[3] = '0' + (OsVersion.getMinor().getValueOr(0) % 10); + Str[4] = '0' + (OsVersion.getSubminor().getValueOr(0) / 10); + Str[5] = '0' + (OsVersion.getSubminor().getValueOr(0) % 10); Str[6] = '\0'; } Builder.defineMacro("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__", Str); @@ -134,7 +134,7 @@ void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, if (Triple.isOSDarwin()) Builder.defineMacro("__MACH__"); - PlatformMinVersion = VersionTuple(Maj, Min, Rev); + PlatformMinVersion = OsVersion; } static void addMinGWDefines(const llvm::Triple &Triple, const LangOptions &Opts, diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h index 7fbe2cb..3c1830d 100644 --- a/clang/lib/Basic/Targets/OSTargets.h +++ b/clang/lib/Basic/Targets/OSTargets.h @@ -148,9 +148,7 @@ public: return 64; } - unsigned Major, Minor, Micro; - T.getOSVersion(Major, Minor, Micro); - if (llvm::VersionTuple(Major, Minor, Micro) < MinVersion) + if (T.getOSVersion() < MinVersion) return 64; return OSTargetInfo<Target>::getExnObjectAlignment(); } @@ -294,7 +292,7 @@ protected: Builder.defineMacro("__HAIKU__"); Builder.defineMacro("__ELF__"); DefineStd(Builder, "unix", Opts); - if (this->HasFloat128) + if (this->HasFloat128) Builder.defineMacro("__FLOAT128__"); } @@ -376,10 +374,9 @@ protected: Builder.defineMacro("__ELF__"); if (Triple.isAndroid()) { Builder.defineMacro("__ANDROID__", "1"); - unsigned Maj, Min, Rev; - Triple.getEnvironmentVersion(Maj, Min, Rev); this->PlatformName = "android"; - this->PlatformMinVersion = VersionTuple(Maj, Min, Rev); + this->PlatformMinVersion = Triple.getEnvironmentVersion(); + const unsigned Maj = this->PlatformMinVersion.getMajor(); if (Maj) { Builder.defineMacro("__ANDROID_MIN_SDK_VERSION__", Twine(Maj)); // This historical but ambiguous name for the minSdkVersion macro. Keep @@ -693,23 +690,32 @@ protected: if (Opts.EnableAIXExtendedAltivecABI) Builder.defineMacro("__EXTABI__"); - unsigned Major, Minor, Micro; - Triple.getOSVersion(Major, Minor, Micro); + VersionTuple OsVersion = Triple.getOSVersion(); // Define AIX OS-Version Macros. // Includes logic for legacy versions of AIX; no specific intent to support. - std::pair<int, int> OsVersion = {Major, Minor}; - if (OsVersion >= std::make_pair(3, 2)) Builder.defineMacro("_AIX32"); - if (OsVersion >= std::make_pair(4, 1)) Builder.defineMacro("_AIX41"); - if (OsVersion >= std::make_pair(4, 3)) Builder.defineMacro("_AIX43"); - if (OsVersion >= std::make_pair(5, 0)) Builder.defineMacro("_AIX50"); - if (OsVersion >= std::make_pair(5, 1)) Builder.defineMacro("_AIX51"); - if (OsVersion >= std::make_pair(5, 2)) Builder.defineMacro("_AIX52"); - if (OsVersion >= std::make_pair(5, 3)) Builder.defineMacro("_AIX53"); - if (OsVersion >= std::make_pair(6, 1)) Builder.defineMacro("_AIX61"); - if (OsVersion >= std::make_pair(7, 1)) Builder.defineMacro("_AIX71"); - if (OsVersion >= std::make_pair(7, 2)) Builder.defineMacro("_AIX72"); - if (OsVersion >= std::make_pair(7, 3)) Builder.defineMacro("_AIX73"); + if (OsVersion >= VersionTuple(3, 2)) + Builder.defineMacro("_AIX32"); + if (OsVersion >= VersionTuple(4, 1)) + Builder.defineMacro("_AIX41"); + if (OsVersion >= VersionTuple(4, 3)) + Builder.defineMacro("_AIX43"); + if (OsVersion >= VersionTuple(5, 0)) + Builder.defineMacro("_AIX50"); + if (OsVersion >= VersionTuple(5, 1)) + Builder.defineMacro("_AIX51"); + if (OsVersion >= VersionTuple(5, 2)) + Builder.defineMacro("_AIX52"); + if (OsVersion >= VersionTuple(5, 3)) + Builder.defineMacro("_AIX53"); + if (OsVersion >= VersionTuple(6, 1)) + Builder.defineMacro("_AIX61"); + if (OsVersion >= VersionTuple(7, 1)) + Builder.defineMacro("_AIX71"); + if (OsVersion >= VersionTuple(7, 2)) + Builder.defineMacro("_AIX72"); + if (OsVersion >= VersionTuple(7, 3)) + Builder.defineMacro("_AIX73"); // FIXME: Do not define _LONG_LONG when -fno-long-long is specified. Builder.defineMacro("_LONG_LONG"); diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h index b9b2ac7..8626e44 100644 --- a/clang/lib/Basic/Targets/X86.h +++ b/clang/lib/Basic/Targets/X86.h @@ -472,10 +472,9 @@ public: : NetBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {} unsigned getFloatEvalMethod() const override { - unsigned Major, Minor, Micro; - getTriple().getOSVersion(Major, Minor, Micro); + VersionTuple OsVersion = getTriple().getOSVersion(); // New NetBSD uses the default rounding mode. - if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 26) || Major == 0) + if (OsVersion >= VersionTuple(6, 99, 26) || OsVersion.getMajor() == 0) return X86_32TargetInfo::getFloatEvalMethod(); // NetBSD before 6.99.26 defaults to "double" rounding. return 1; diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index 89d8fbe..f7da3f1 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -1410,8 +1410,8 @@ static std::string getSystemOrSDKMacOSVersion(StringRef MacOSSDKVersion) { llvm::Triple SystemTriple(llvm::sys::getProcessTriple()); if (!SystemTriple.isMacOSX()) return std::string(MacOSSDKVersion); - SystemTriple.getMacOSXVersion(Major, Minor, Micro); - VersionTuple SystemVersion(Major, Minor, Micro); + VersionTuple SystemVersion; + SystemTriple.getMacOSXVersion(SystemVersion); bool HadExtra; if (!Driver::GetReleaseVersion(MacOSSDKVersion, Major, Minor, Micro, HadExtra)) @@ -1552,12 +1552,10 @@ struct DarwinPlatform { const Optional<DarwinSDKInfo> &SDKInfo) { DarwinPlatform Result(TargetArg, getPlatformFromOS(TT.getOS()), OSVersion, A); - unsigned Major, Minor, Micro; - TT.getOSVersion(Major, Minor, Micro); - if (Major == 0) + VersionTuple OsVersion = TT.getOSVersion(); + if (OsVersion.getMajor() == 0) Result.HasOSVersion = false; - Result.setEnvironment(TT.getEnvironment(), - VersionTuple(Major, Minor, Micro), SDKInfo); + Result.setEnvironment(TT.getEnvironment(), OsVersion, SDKInfo); return Result; } static DarwinPlatform @@ -1803,7 +1801,7 @@ inferDeploymentTargetFromSDK(DerivedArgList &Args, std::string getOSVersion(llvm::Triple::OSType OS, const llvm::Triple &Triple, const Driver &TheDriver) { - unsigned Major, Minor, Micro; + VersionTuple OsVersion; llvm::Triple SystemTriple(llvm::sys::getProcessTriple()); switch (OS) { case llvm::Triple::Darwin: @@ -1812,24 +1810,22 @@ std::string getOSVersion(llvm::Triple::OSType OS, const llvm::Triple &Triple, // macos, use the host triple to infer OS version. if (Triple.isMacOSX() && SystemTriple.isMacOSX() && !Triple.getOSMajorVersion()) - SystemTriple.getMacOSXVersion(Major, Minor, Micro); - else if (!Triple.getMacOSXVersion(Major, Minor, Micro)) + SystemTriple.getMacOSXVersion(OsVersion); + else if (!Triple.getMacOSXVersion(OsVersion)) TheDriver.Diag(diag::err_drv_invalid_darwin_version) << Triple.getOSName(); break; case llvm::Triple::IOS: if (Triple.isMacCatalystEnvironment() && !Triple.getOSMajorVersion()) { - Major = 13; - Minor = 1; - Micro = 0; + OsVersion = VersionTuple(13, 1); } else - Triple.getiOSVersion(Major, Minor, Micro); + OsVersion = Triple.getiOSVersion(); break; case llvm::Triple::TvOS: - Triple.getOSVersion(Major, Minor, Micro); + OsVersion = Triple.getOSVersion(); break; case llvm::Triple::WatchOS: - Triple.getWatchOSVersion(Major, Minor, Micro); + OsVersion = Triple.getWatchOSVersion(); break; default: llvm_unreachable("Unexpected OS type"); @@ -1837,7 +1833,9 @@ std::string getOSVersion(llvm::Triple::OSType OS, const llvm::Triple &Triple, } std::string OSVersion; - llvm::raw_string_ostream(OSVersion) << Major << '.' << Minor << '.' << Micro; + llvm::raw_string_ostream(OSVersion) + << OsVersion.getMajor() << '.' << OsVersion.getMinor().getValueOr(0) + << '.' << OsVersion.getSubminor().getValueOr(0); return OSVersion; } @@ -1907,15 +1905,13 @@ getDeploymentTargetFromMTargetOSArg(DerivedArgList &Args, return None; } - unsigned Major, Minor, Micro; - TT.getOSVersion(Major, Minor, Micro); - if (!Major) { + VersionTuple Version = TT.getOSVersion(); + if (!Version.getMajor()) { TheDriver.Diag(diag::err_drv_invalid_version_number) << A->getAsString(Args); return None; } - return DarwinPlatform::createFromMTargetOS(TT.getOS(), - VersionTuple(Major, Minor, Micro), + return DarwinPlatform::createFromMTargetOS(TT.getOS(), Version, TT.getEnvironment(), A, SDKInfo); } diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index 1987745..7494c21 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -277,14 +277,11 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) // Android sysroots contain a library directory for each supported OS // version as well as some unversioned libraries in the usual multiarch // directory. - unsigned Major; - unsigned Minor; - unsigned Micro; - Triple.getEnvironmentVersion(Major, Minor, Micro); - addPathIfExists(D, - SysRoot + "/usr/lib/" + MultiarchTriple + "/" + - llvm::to_string(Major), - Paths); + addPathIfExists( + D, + SysRoot + "/usr/lib/" + MultiarchTriple + "/" + + llvm::to_string(Triple.getEnvironmentVersion().getMajor()), + Paths); } addPathIfExists(D, SysRoot + "/usr/lib/" + MultiarchTriple, Paths); diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp index 792b0a5..66e9d8a 100644 --- a/clang/lib/Driver/ToolChains/MSVC.cpp +++ b/clang/lib/Driver/ToolChains/MSVC.cpp @@ -1194,14 +1194,6 @@ bool MSVCToolChain::getUniversalCRTLibraryPath(const ArgList &Args, return true; } -static VersionTuple getMSVCVersionFromTriple(const llvm::Triple &Triple) { - unsigned Major, Minor, Micro; - Triple.getEnvironmentVersion(Major, Minor, Micro); - if (Major || Minor || Micro) - return VersionTuple(Major, Minor, Micro); - return VersionTuple(); -} - static VersionTuple getMSVCVersionFromExe(const std::string &BinDir) { VersionTuple Version; #ifdef _WIN32 @@ -1374,7 +1366,7 @@ VersionTuple MSVCToolChain::computeMSVCVersion(const Driver *D, bool IsWindowsMSVC = getTriple().isWindowsMSVCEnvironment(); VersionTuple MSVT = ToolChain::computeMSVCVersion(D, Args); if (MSVT.empty()) - MSVT = getMSVCVersionFromTriple(getTriple()); + MSVT = getTriple().getEnvironmentVersion(); if (MSVT.empty() && IsWindowsMSVC) MSVT = getMSVCVersionFromExe(getSubDirectoryPath(SubDirectoryType::Bin)); if (MSVT.empty() && diff --git a/clang/lib/Driver/ToolChains/NetBSD.cpp b/clang/lib/Driver/ToolChains/NetBSD.cpp index 7571398..37b1fc5 100644 --- a/clang/lib/Driver/ToolChains/NetBSD.cpp +++ b/clang/lib/Driver/ToolChains/NetBSD.cpp @@ -270,10 +270,9 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString(ToolChain.getCompilerRTPath())); } - unsigned Major, Minor, Micro; - Triple.getOSVersion(Major, Minor, Micro); + VersionTuple OsVersion = Triple.getOSVersion(); bool useLibgcc = true; - if (Major >= 7 || Major == 0) { + if (OsVersion >= VersionTuple(7) || OsVersion.getMajor() == 0) { switch (ToolChain.getArch()) { case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: @@ -409,9 +408,8 @@ Tool *NetBSD::buildAssembler() const { Tool *NetBSD::buildLinker() const { return new tools::netbsd::Linker(*this); } ToolChain::CXXStdlibType NetBSD::GetDefaultCXXStdlibType() const { - unsigned Major, Minor, Micro; - getTriple().getOSVersion(Major, Minor, Micro); - if (Major >= 7 || Major == 0) { + VersionTuple OsVersion = getTriple().getOSVersion(); + if (OsVersion >= VersionTuple(7) || OsVersion.getMajor() == 0) { switch (getArch()) { case llvm::Triple::aarch64: case llvm::Triple::aarch64_be: @@ -505,14 +503,13 @@ void NetBSD::addClangTargetOptions(const ArgList &DriverArgs, if (SanArgs.hasAnySanitizer()) CC1Args.push_back("-D_REENTRANT"); - unsigned Major, Minor, Micro; - getTriple().getOSVersion(Major, Minor, Micro); + VersionTuple OsVersion = getTriple().getOSVersion(); bool UseInitArrayDefault = - Major >= 9 || Major == 0 || - getTriple().getArch() == llvm::Triple::aarch64 || - getTriple().getArch() == llvm::Triple::aarch64_be || - getTriple().getArch() == llvm::Triple::arm || - getTriple().getArch() == llvm::Triple::armeb; + OsVersion >= VersionTuple(9) || OsVersion.getMajor() == 0 || + getTriple().getArch() == llvm::Triple::aarch64 || + getTriple().getArch() == llvm::Triple::aarch64_be || + getTriple().getArch() == llvm::Triple::arm || + getTriple().getArch() == llvm::Triple::armeb; if (!DriverArgs.hasFlag(options::OPT_fuse_init_array, options::OPT_fno_use_init_array, UseInitArrayDefault)) diff --git a/clang/test/Sema/attr-availability-android.c b/clang/test/Sema/attr-availability-android.c index f38f71f..39638bc 100644 --- a/clang/test/Sema/attr-availability-android.c +++ b/clang/test/Sema/attr-availability-android.c @@ -5,7 +5,7 @@ void f0(int) __attribute__((availability(android,introduced=14,deprecated=19))); void f1(int) __attribute__((availability(android,introduced=16))); void f2(int) __attribute__((availability(android,introduced=14,deprecated=16))); // expected-note {{'f2' has been explicitly marked deprecated here}} #ifdef WARN_PARTIAL -// expected-note-re@+2 {{'f3' has been marked as being introduced in Android 19 here, but the deployment target is Android 16.0.0{{$}}}} +// expected-note-re@+2 {{'f3' has been marked as being introduced in Android 19 here, but the deployment target is Android 16{{$}}}} #endif void f3(int) __attribute__((availability(android,introduced=19))); void f4(int) __attribute__((availability(android,introduced=9,deprecated=11,obsoleted=16), availability(ios,introduced=2.0,deprecated=3.0))); // expected-note{{explicitly marked unavailable}} diff --git a/clang/test/Sema/attr-availability.c b/clang/test/Sema/attr-availability.c index dbdf6593..b34d3d6 100644 --- a/clang/test/Sema/attr-availability.c +++ b/clang/test/Sema/attr-availability.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -fblocks -verify %s // RUN: %clang_cc1 -D WARN_PARTIAL -Wpartial-availability -triple x86_64-apple-darwin9 -fsyntax-only -fblocks -verify %s -// +// void f0() __attribute__((availability(macosx,introduced=10.4,deprecated=10.2))); // expected-warning{{feature cannot be deprecated in macOS version 10.2 before it was introduced in version 10.4; attribute ignored}} void f1() __attribute__((availability(ios,obsoleted=2.1,deprecated=3.0))); // expected-warning{{feature cannot be obsoleted in iOS version 2.1 before it was deprecated in version 3.0; attribute ignored}} @@ -9,20 +9,20 @@ void f2() __attribute__((availability(ios,introduced=2.1,deprecated=2.1))); void f3() __attribute__((availability(otheros,introduced=2.2))); // expected-warning{{unknown platform 'otheros' in availability macro}} // rdar://10095131 -extern void +extern void ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); // expected-note {{'ATSFontGetName' has been explicitly marked deprecated here}} extern void ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{'ATSFontGetPostScriptName' has been explicitly marked unavailable here}} #if defined(WARN_PARTIAL) -// expected-note@+3 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+3 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif extern void PartiallyAvailable() __attribute__((availability(macosx,introduced=10.8))); #ifdef WARN_PARTIAL -// expected-note@+2 2 {{'PartialEnum' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 2 {{'PartialEnum' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif enum __attribute__((availability(macosx,introduced=10.8))) PartialEnum { kPartialEnumConstant, @@ -41,7 +41,7 @@ void test_10095131() { #ifdef WARN_PARTIAL // FIXME: This note should point to the declaration with the availability // attribute. -// expected-note@+2 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif extern void PartiallyAvailable() ; void with_redeclaration() { diff --git a/clang/test/Sema/availability-guard-format.mm b/clang/test/Sema/availability-guard-format.mm index 0e158c4..e5967d1 100644 --- a/clang/test/Sema/availability-guard-format.mm +++ b/clang/test/Sema/availability-guard-format.mm @@ -3,7 +3,7 @@ // Testing that even for source code using '_' as a delimiter in availability version tuple '.' is actually used in diagnostic output as a delimiter. @interface foo -- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.11.0}} +- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.11}} @end int main() { diff --git a/clang/test/SemaObjC/attr-availability.m b/clang/test/SemaObjC/attr-availability.m index cb89615..e3f7a38 100644 --- a/clang/test/SemaObjC/attr-availability.m +++ b/clang/test/SemaObjC/attr-availability.m @@ -5,7 +5,7 @@ - (void)proto_method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note 2 {{'proto_method' has been explicitly marked deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+2 2 {{'partial_proto_method' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 2 {{'partial_proto_method' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif - (void)partial_proto_method __attribute__((availability(macosx,introduced=10.8))); @end @@ -13,7 +13,7 @@ @interface A <P> - (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{'method' has been explicitly marked deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+2 2 {{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 2 {{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif - (void)partialMethod __attribute__((availability(macosx,introduced=10.8))); @@ -137,8 +137,8 @@ id NSNibOwner, topNibObjects; @interface PartialI <PartialProt> #ifdef WARN_PARTIAL -// expected-note@+3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} -// expected-note@+3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} +// expected-note@+3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif - (void)partialMethod __attribute__((availability(macosx,introduced=10.8))); + (void)partialMethod __attribute__((availability(macosx,introduced=10.8))); @@ -147,12 +147,12 @@ id NSNibOwner, topNibObjects; @interface PartialI () - (void)ipartialMethod1 __attribute__((availability(macosx,introduced=10.8))); #if defined(WARN_PARTIAL) -// expected-note@+2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif - (void)ipartialMethod2 __attribute__((availability(macosx,introduced=10.8))); + (void)ipartialMethod1 __attribute__((availability(macosx,introduced=10.8))); #if defined(WARN_PARTIAL) -// expected-note@+2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif + (void)ipartialMethod2 __attribute__((availability(macosx,introduced=10.8))); @end @@ -190,7 +190,7 @@ void partialfun(PartialI* a) { } #if defined(WARN_PARTIAL) -// expected-note@+2 2 {{'PartialI2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +// expected-note@+2 2 {{'PartialI2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} #endif __attribute__((availability(macosx, introduced = 10.8))) @interface PartialI2 @end @@ -222,7 +222,7 @@ enum MyEnum : int { // expected-note {{'MyEnum' has been explicitly marked unava void use_myEnum() { // expected-error@+2 {{'MyEnum' is unavailable: not available}} // expected-error@+1 {{MyEnum_Blah' is unavailable: not available}} - MyEnum e = MyEnum_Blah; + MyEnum e = MyEnum_Blah; } // Test that the availability of (optional) protocol methods is not @@ -313,8 +313,8 @@ __attribute__((objc_root_class)) #if defined(WARN_PARTIAL) int fn_10_5() __attribute__((availability(macosx, introduced=10.5))); -int fn_10_7() __attribute__((availability(macosx, introduced=10.7))); // expected-note{{'fn_10_7' has been marked as being introduced in macOS 10.7 here, but the deployment target is macOS 10.5.0}} -int fn_10_8() __attribute__((availability(macosx, introduced=10.8))) { // expected-note{{'fn_10_8' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}} +int fn_10_7() __attribute__((availability(macosx, introduced=10.7))); // expected-note{{'fn_10_7' has been marked as being introduced in macOS 10.7 here, but the deployment target is macOS 10.5}} +int fn_10_8() __attribute__((availability(macosx, introduced=10.8))) { // expected-note{{'fn_10_8' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5}} return fn_10_7(); } diff --git a/clang/test/SemaObjC/property-deprecated-warning.m b/clang/test/SemaObjC/property-deprecated-warning.m index a1e9711..45e098b 100644 --- a/clang/test/SemaObjC/property-deprecated-warning.m +++ b/clang/test/SemaObjC/property-deprecated-warning.m @@ -9,7 +9,7 @@ typedef signed char BOOL; @property(nonatomic,assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'ptarget' is declared deprecated here}} expected-note {{'ptarget' has been explicitly marked deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+2 {{'partialPtarget' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} +// expected-note@+2 {{'partialPtarget' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} #endif @property(nonatomic,assign) id partialPtarget __attribute__((availability(ios,introduced=5.0))); @end @@ -24,7 +24,7 @@ typedef signed char BOOL; @property(nonatomic,assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'target' is declared deprecated here}} expected-note {{'setTarget:' has been explicitly marked deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+2 {{'setPartialTarget:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} +// expected-note@+2 {{'setPartialTarget:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} #endif @property(nonatomic,assign) id partialTarget __attribute__((availability(ios,introduced=5.0))); @end @@ -40,8 +40,8 @@ typedef signed char BOOL; // expected-note 2 {{'setDep_target:' has been explicitly marked deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+3 2 {{'partial_dep_target' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} -// expected-note@+2 2 {{'setPartial_dep_target:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} +// expected-note@+3 2 {{'partial_dep_target' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} +// expected-note@+2 2 {{'setPartial_dep_target:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} #endif @property(nonatomic,assign) id partial_dep_target __attribute__((availability(ios,introduced=5.0))); @end @@ -54,7 +54,7 @@ typedef signed char BOOL; [self setTarget: (id)0]; // no-warning [self setDep_target: [self dep_target]]; // expected-warning {{'dep_target' is deprecated: first deprecated in iOS 3.0}} \ // expected-warning {{'setDep_target:' is deprecated: first deprecated in iOS 3.0}} - + [self setPtarget: (id)0]; // no-warning [self setPartialTarget: (id)0]; // no-warning #if defined(WARN_PARTIAL) @@ -101,12 +101,12 @@ typedef signed char BOOL; @property(setter=setNewDelegate:,assign) id delegate __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'setNewDelegate:' has been explicitly marked deprecated here}} expected-note {{property 'delegate' is declared deprecated here}} #if defined(WARN_PARTIAL) -// expected-note@+2 {{'partialIsEnabled' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} +// expected-note@+2 {{'partialIsEnabled' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} #endif @property(getter=partialIsEnabled,assign) BOOL partialEnabled __attribute__((availability(ios,introduced=5.0))); #if defined(WARN_PARTIAL) -// expected-note@+2 {{'partialSetNewDelegate:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}} +// expected-note@+2 {{'partialSetNewDelegate:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0}} #endif @property(setter=partialSetNewDelegate:,assign) id partialDelegate __attribute__((availability(ios,introduced=5.0))); @end diff --git a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m index 590304d..9d05a2b 100644 --- a/clang/test/SemaObjC/unguarded-availability-maccatalyst.m +++ b/clang/test/SemaObjC/unguarded-availability-maccatalyst.m @@ -15,7 +15,7 @@ void previouslyAvailable() AVAILABLE_PREV; void currentlyAvailable() AVAILABLE_CURRENT; void willBeAvailabile() AVAILABLE_NEXT; #ifndef NO_WARNING -// expected-note@-2 {{'willBeAvailabile' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14.0.0}} +// expected-note@-2 {{'willBeAvailabile' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif @@ -23,7 +23,7 @@ typedef struct { } Record AVAILABLE_NEXT; #ifndef NO_WARNING -// expected-note@-2 {{'Record' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14.0.0}} +// expected-note@-2 {{'Record' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif AVAILABLE_PREV @@ -56,7 +56,7 @@ void previouslyAvailableIOS() __attribute__((availability(ios, introduced = 10)) void currentlyAvailableIOS() __attribute__((availability(ios, introduced = 14))); void willBeAvailabileIOS() __attribute__((availability(ios, introduced = 14.1))); #ifndef NO_WARNING -// expected-note@-2 {{'willBeAvailabileIOS' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14.0.0}} +// expected-note@-2 {{'willBeAvailabileIOS' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif void testIOSAvailabilityAlsoWorks() { @@ -77,7 +77,7 @@ typedef struct { } Record2 __attribute__((availability(ios, introduced = 14.1))); #ifndef NO_WARNING -// expected-note@-2 {{'Record2' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14.0.0}} +// expected-note@-2 {{'Record2' has been marked as being introduced in macCatalyst 14.1 here, but the deployment target is macCatalyst 14}} #endif __attribute__((availability(ios, introduced = 10))) diff --git a/clang/test/SemaObjC/unguarded-availability.m b/clang/test/SemaObjC/unguarded-availability.m index 0ee5730..dffad1d 100644 --- a/clang/test/SemaObjC/unguarded-availability.m +++ b/clang/test/SemaObjC/unguarded-availability.m @@ -5,14 +5,14 @@ #define AVAILABLE_10_11 __attribute__((availability(macos, introduced = 10.11))) #define AVAILABLE_10_12 __attribute__((availability(macos, introduced = 10.12))) -typedef int AVAILABLE_10_12 new_int; // expected-note + {{'new_int' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +typedef int AVAILABLE_10_12 new_int; // expected-note + {{'new_int' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} -int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}} +int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}} #ifdef OBJCPP -// expected-note@+2 6 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +// expected-note@+2 6 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} #endif -int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} int func_10_0() AVAILABLE_10_0; @@ -61,11 +61,11 @@ void star_case() { } } -typedef int int_10_11 AVAILABLE_10_11; // expected-note {{'int_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}} +typedef int int_10_11 AVAILABLE_10_11; // expected-note {{'int_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}} #ifdef OBJCPP -// expected-note@+2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +// expected-note@+2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} #endif -typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} void use_typedef() { int_10_11 x; // expected-warning{{'int_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'int_10_11' in an @available check to silence this warning}} @@ -106,10 +106,10 @@ int protected_scope() { struct S { int m1; - int m2 __attribute__((availability(macos, introduced = 10.12))); // expected-note{{has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} + int m2 __attribute__((availability(macos, introduced = 10.12))); // expected-note{{has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} struct Nested { - int nested_member __attribute__((availability(macos, introduced = 10.12))); // expected-note{{'nested_member' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} + int nested_member __attribute__((availability(macos, introduced = 10.12))); // expected-note{{'nested_member' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} } n; }; @@ -147,9 +147,9 @@ void (^topLevelBlockDecl)() = ^ { AVAILABLE_10_12 __attribute__((objc_root_class)) -@interface InterWithProp // expected-note 2 {{'InterWithProp' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +@interface InterWithProp // expected-note 2 {{'InterWithProp' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} @property(class) int x; -+ (void) setX: (int)newX AVAILABLE_10_12; // expected-note{{'setX:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} ++ (void) setX: (int)newX AVAILABLE_10_12; // expected-note{{'setX:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} @end void test_property(void) { int y = InterWithProp.x; // expected-warning{{'InterWithProp' is only available on macOS 10.12 or newer}} expected-note{{@available}} @@ -158,7 +158,7 @@ void test_property(void) { __attribute__((objc_root_class)) @interface Subscriptable -- (id)objectAtIndexedSubscript:(int)sub AVAILABLE_10_12; // expected-note{{'objectAtIndexedSubscript:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +- (id)objectAtIndexedSubscript:(int)sub AVAILABLE_10_12; // expected-note{{'objectAtIndexedSubscript:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} @end void test_at(Subscriptable *x) { @@ -204,7 +204,7 @@ int instantiate_template() { } template <class> -int with_availability_attr() AVAILABLE_10_11 { // expected-note 2 {{'with_availability_attr<int>' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}} +int with_availability_attr() AVAILABLE_10_11 { // expected-note 2 {{'with_availability_attr<int>' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9}} return 0; } @@ -282,9 +282,9 @@ struct InStruct { // expected-note{{annotate 'InStruct' with an availability att }; #ifdef OBJCPP -static constexpr int AVAILABLE_10_12 SomeConstexprValue = 2; // expected-note{{'SomeConstexprValue' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +static constexpr int AVAILABLE_10_12 SomeConstexprValue = 2; // expected-note{{'SomeConstexprValue' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} typedef enum { // expected-note{{annotate anonymous enum with an availability attribute}} - SomeValue = SomeConstexprValue // expected-warning{{'SomeConstexprValue' is only available on macOS 10.12 or newer}} + SomeValue = SomeConstexprValue // expected-warning{{'SomeConstexprValue' is only available on macOS 10.12 or newer}} } SomeEnum; #endif @@ -297,7 +297,7 @@ typedef enum { // expected-note{{annotate anonymous enum with an availability at @end void with_local_struct() { - struct local { + struct local { new_int x; // expected-warning{{'new_int' is only available}} expected-note{{enclose 'new_int' in an @available check}} }; if (@available(macos 10.12, *)) { @@ -311,7 +311,7 @@ void with_local_struct() { // Avoid the warning on protocol requirements. AVAILABLE_10_12 -@protocol NewProtocol // expected-note {{'NewProtocol' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} +@protocol NewProtocol // expected-note {{'NewProtocol' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} @end @protocol ProtocolWithNewProtocolRequirement <NewProtocol> // expected-note {{annotate 'ProtocolWithNewProtocolRequirement' with an availability attribute to silence}} @@ -334,7 +334,7 @@ AVAILABLE_10_12 typedef enum { AK_Dodo __attribute__((availability(macos, deprecated=10.3))), // expected-note 3 {{marked deprecated here}} AK_Cat __attribute__((availability(macos, introduced=10.4))), - AK_CyborgCat __attribute__((availability(macos, introduced=10.12))), // expected-note {{'AK_CyborgCat' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}} + AK_CyborgCat __attribute__((availability(macos, introduced=10.12))), // expected-note {{'AK_CyborgCat' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9}} } Animals; void switchAnimals(Animals a) { |