]> granicus.if.org Git - clang/commitdiff
Use Decl::getAvailability() rather than checking for the "unavailable"
authorDouglas Gregor <dgregor@apple.com>
Tue, 8 Jan 2013 18:16:18 +0000 (18:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 8 Jan 2013 18:16:18 +0000 (18:16 +0000)
attribute when determining whether we need to see an implementation of
a property. Fixes <rdar://problem/12958191>.

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

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/no-warning-unavail-unimp.m

index 170bbde370c9f6b3a90e861c68f046c89b4438d8..a605ed52a6778c219d7dca09f1ed19e0d174036a 100644 (file)
@@ -1605,7 +1605,8 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl,
     // Is there a matching propery synthesize/dynamic?
     if (Prop->isInvalidDecl() ||
         Prop->getPropertyImplementation() == ObjCPropertyDecl::Optional ||
-        PropImplMap.count(Prop) || Prop->hasAttr<UnavailableAttr>())
+        PropImplMap.count(Prop) ||
+        Prop->getAvailability() == AR_Unavailable)
       continue;
     if (!InsMap.count(Prop->getGetterName())) {
       Diag(IMPDecl->getLocation(),
index d5a4eac9906764bcf9486485924b88289f55f1f4..037bf24ce92dd8a5df26fc07a26dfd3ee68e65ac 100644 (file)
@@ -1,9 +1,11 @@
-// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
 // expected-no-diagnostics
 // rdar://9651605
+// rdar://12958191
 
 @interface Foo
 @property (getter=getVal) int val __attribute__((unavailable));
+@property (getter=getVal) int val2 __attribute__((availability(macosx,unavailable)));
 - Method __attribute__((unavailable));
 + CMethod __attribute__((unavailable));
 @end