[cfe-commits] r171877 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/no-warning-unavail-unimp.m

Douglas Gregor dgregor at apple.com
Tue Jan 8 10:16:18 PST 2013


Author: dgregor
Date: Tue Jan  8 12:16:18 2013
New Revision: 171877

URL: http://llvm.org/viewvc/llvm-project?rev=171877&view=rev
Log:
Use Decl::getAvailability() rather than checking for the "unavailable"
attribute when determining whether we need to see an implementation of
a property. Fixes <rdar://problem/12958191>.

Modified:
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/no-warning-unavail-unimp.m

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=171877&r1=171876&r2=171877&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue Jan  8 12:16:18 2013
@@ -1605,7 +1605,8 @@
     // 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(),

Modified: cfe/trunk/test/SemaObjC/no-warning-unavail-unimp.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/no-warning-unavail-unimp.m?rev=171877&r1=171876&r2=171877&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/no-warning-unavail-unimp.m (original)
+++ cfe/trunk/test/SemaObjC/no-warning-unavail-unimp.m Tue Jan  8 12:16:18 2013
@@ -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));
+ at property (getter=getVal) int val2 __attribute__((availability(macosx,unavailable)));
 - Method __attribute__((unavailable));
 + CMethod __attribute__((unavailable));
 @end





More information about the cfe-commits mailing list