[cfe-commits] r138598 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjC/protocol-implementing-class-methods.m
Fariborz Jahanian
fjahanian at apple.com
Thu Aug 25 15:58:42 PDT 2011
Author: fjahanian
Date: Thu Aug 25 17:58:42 2011
New Revision: 138598
URL: http://llvm.org/viewvc/llvm-project?rev=138598&view=rev
Log:
Don't warn on category implementing a method, if
declated method in the class belongs to a synthesized
property getter/setter. // rdar://10014946
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/protocol-implementing-class-methods.m
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=138598&r1=138597&r2=138598&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Aug 25 17:58:42 2011
@@ -1488,7 +1488,7 @@
if (!WarnExactMatch)
WarnConflictingTypedMethods(ImpMethodDecl, MethodDecl,
isa<ObjCProtocolDecl>(CDecl));
- else
+ else if (!MethodDecl->isSynthesized())
WarnExactTypedMethods(ImpMethodDecl, MethodDecl,
isa<ObjCProtocolDecl>(CDecl));
}
Modified: cfe/trunk/test/SemaObjC/protocol-implementing-class-methods.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-implementing-class-methods.m?rev=138598&r1=138597&r2=138598&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/protocol-implementing-class-methods.m (original)
+++ cfe/trunk/test/SemaObjC/protocol-implementing-class-methods.m Thu Aug 25 17:58:42 2011
@@ -26,3 +26,16 @@
- (void) : (double) arg{}; // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
- (void) CEMeth {}; // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
@end
+
+// rdar://10014946
+typedef char BOOL;
+ at interface I
+{
+ BOOL allowsDeleting;
+}
+ at property (nonatomic, assign, readwrite) BOOL allowsDeleting;
+ at end
+
+ at implementation I(CAT)
+- (BOOL) allowsDeleting { return 1; }
+ at end
More information about the cfe-commits
mailing list