From: Fariborz Jahanian Date: Thu, 2 Jan 2014 17:24:32 +0000 (+0000) Subject: ObjectiveC. Class methods must be ignored when looking for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2f5c3c85f3dc3ea39cc6ee00d89a231f955d8e2;p=clang ObjectiveC. Class methods must be ignored when looking for 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 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 078a0e3ab9..7024cf6cb3 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -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; diff --git a/test/SemaObjC/unsued-backing-ivar-warning.m b/test/SemaObjC/unsued-backing-ivar-warning.m index df3ede75af..9861d5048f 100644 --- a/test/SemaObjC/unsued-backing-ivar-warning.m +++ b/test/SemaObjC/unsued-backing-ivar-warning.m @@ -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