]> granicus.if.org Git - clang/commitdiff
ObjectiveC. Class methods must be ignored when looking for
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901

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

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/unsued-backing-ivar-warning.m

index 078a0e3ab9fb3662b44a472bd4f7ea41f4bdf11c..7024cf6cb354220e41deda422eecb83e0c9b8b7e 100644 (file)
@@ -3489,7 +3489,8 @@ void Sema::DiagnoseUseOfUnimplementedSelectors() {
 ObjCIvarDecl *
 Sema::GetIvarBackingPropertyAccessor(const ObjCMethodDecl *Method,
                                      const ObjCPropertyDecl *&PDecl) const {
-  
+  if (Method->isClassMethod())
+    return 0;
   const ObjCInterfaceDecl *IDecl = Method->getClassInterface();
   if (!IDecl)
     return 0;
index df3ede75afa8f1f1d70ccb625456ab5e29e89980..9861d5048f701a84364d6aac04a2a6cd35b002c0 100644 (file)
@@ -91,3 +91,16 @@ typedef char BOOL;
 }
 @end
 
+// rdar://15728901
+@interface GATTOperation : NSObject {
+    long operation;
+}
+@property(assign) long operation;
+@end
+
+@implementation GATTOperation
+@synthesize operation;
++ (id) operation {
+    return 0;
+}
+@end