r198322 - ObjectiveC. Class methods must be ignored when looking for
Fariborz Jahanian
fjahanian at apple.com
Thu Jan 2 09:24:32 PST 2014
Author: fjahanian
Date: Thu Jan 2 11:24:32 2014
New Revision: 198322
URL: http://llvm.org/viewvc/llvm-project?rev=198322&view=rev
Log:
ObjectiveC. Class methods must be ignored when looking for
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/unsued-backing-ivar-warning.m
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=198322&r1=198321&r2=198322&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jan 2 11:24:32 2014
@@ -3489,7 +3489,8 @@ void Sema::DiagnoseUseOfUnimplementedSel
ObjCIvarDecl *
Sema::GetIvarBackingPropertyAccessor(const ObjCMethodDecl *Method,
const ObjCPropertyDecl *&PDecl) const {
-
+ if (Method->isClassMethod())
+ return 0;
const ObjCInterfaceDecl *IDecl = Method->getClassInterface();
if (!IDecl)
return 0;
Modified: cfe/trunk/test/SemaObjC/unsued-backing-ivar-warning.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/unsued-backing-ivar-warning.m?rev=198322&r1=198321&r2=198322&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/unsued-backing-ivar-warning.m (original)
+++ cfe/trunk/test/SemaObjC/unsued-backing-ivar-warning.m Thu Jan 2 11:24:32 2014
@@ -91,3 +91,16 @@ typedef char BOOL;
}
@end
+// rdar://15728901
+ at interface GATTOperation : NSObject {
+ long operation;
+}
+ at property(assign) long operation;
+ at end
+
+ at implementation GATTOperation
+ at synthesize operation;
++ (id) operation {
+ return 0;
+}
+ at end
More information about the cfe-commits
mailing list