]> granicus.if.org Git - clang/commitdiff
[ObjC Availability] Fix partial-availability false positive introduced in r277058
authorErik Pilkington <erik.pilkington@gmail.com>
Mon, 1 Aug 2016 20:19:49 +0000 (20:19 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Mon, 1 Aug 2016 20:19:49 +0000 (20:19 +0000)
Thanks to Nico Weber for pointing this out!

Differential revision: https://reviews.llvm.org/D23024

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277378 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/attr-availability.m

index 287632382dd99b40cb05b4aeedf6358fd3db936a..edecc06e496a8fd36c7ac1500dd7e4dbaf6d786d 100644 (file)
@@ -6505,5 +6505,5 @@ VersionTuple Sema::getVersionForDecl(const Decl *D) const {
         DeclVersion = AA->getIntroduced();
   }
 
-  return DeclVersion;
+  return std::max(DeclVersion, Context.getTargetInfo().getPlatformMinVersion());
 }
index 1be949086dcf1fc0eefa2028a8038b0fee53cf71..dfd544ba0254ef5f037d2ad385cfa1f3888db525 100644 (file)
@@ -297,6 +297,7 @@ __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{{marked partial here}}
 int fn_10_8() __attribute__((availability(macosx, introduced=10.8))) { // expected-note{{marked partial here}}
   return fn_10_7();
@@ -324,4 +325,8 @@ __attribute__((availability(macosx, introduced=10.7)))
 -(void)method4 { fn_10_8(); }
 @end
 
+int old_func() __attribute__((availability(macos, introduced=10.4))) {
+  fn_10_5();
+}
+
 #endif