]> granicus.if.org Git - clang/commitdiff
Don't warn on category implementing a method, if
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 25 Aug 2011 22:58:42 +0000 (22:58 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 25 Aug 2011 22:58:42 +0000 (22:58 +0000)
declated method in the class belongs to a synthesized
property getter/setter. // rdar://10014946

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

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/protocol-implementing-class-methods.m

index 03081bec1388f7ab2c8e4006282bb1f837a3dcf5..af14aa4f84f2f6b4cd096e5b110998c0e1ae3483 100644 (file)
@@ -1488,7 +1488,7 @@ void Sema::MatchAllMethodDeclarations(const llvm::DenseSet<Selector> &InsMap,
         if (!WarnExactMatch)
           WarnConflictingTypedMethods(ImpMethodDecl, MethodDecl,
                                       isa<ObjCProtocolDecl>(CDecl));
-        else
+        else if (!MethodDecl->isSynthesized())
           WarnExactTypedMethods(ImpMethodDecl, MethodDecl,
                                isa<ObjCProtocolDecl>(CDecl));
       }
index 6d68e8c21cb1b466d24352159e815445261023e3..f08a5a97d8b78e138cd4b8e82c552fdbc6c757d9 100644 (file)
 - (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;
+@interface I
+{
+  BOOL allowsDeleting;
+}
+@property (nonatomic, assign, readwrite) BOOL allowsDeleting;
+@end
+
+@implementation I(CAT)
+- (BOOL) allowsDeleting { return 1; }
+@end