Fix implicit ios -> watchOS availability version mapping for

versions that have the major number only

rdar://48018651

llvm-svn: 356605
This commit is contained in:
Alex Lorenz 2019-03-20 20:02:00 +00:00
parent f7522cab39
commit 0b4364847d
2 changed files with 7 additions and 0 deletions

View File

@ -2508,6 +2508,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
else
return VersionTuple(NewMajor, Version.getMinor().getValue());
}
return VersionTuple(NewMajor);
}
return VersionTuple(2, 0);

View File

@ -52,3 +52,9 @@ void test_watchos() {
f5c_watchos(0); // expected-warning {{'f5c_watchos' is deprecated: first deprecated in watchOS 2.0}}
f6_watchos(0); // expected-warning {{'f6_watchos' is deprecated: first deprecated in watchOS 3.0}}
}
void deprecatedAfterIntroduced() __attribute__((availability(ios,introduced=9.3,deprecated=10))); // expected-note {{here}}
void test_ios_correctly_map_to_watchos() {
deprecatedAfterIntroduced(); // expected-warning {{'deprecatedAfterIntroduced' is deprecated: first deprecated in watchOS 3}}
}