was not being overridden in the category method implementation
resulting in bogus warning. // rdar://
15919775
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200342
91177308-0d34-0410-b5e6-
96231b3b80d8
ObjCMethod->getLocation()));
}
if (isa<ObjCCategoryImplDecl>(ImpDecl)) {
- ObjCMethodFamily family = ObjCMethod->getMethodFamily();
+ ObjCMethodFamily family =
+ ObjCMethod->getSelector().getMethodFamily();
if (family == OMF_dealloc && IMD && IMD->isOverriding())
Diag(ObjCMethod->getLocation(), diag::warn_dealloc_in_category)
<< ObjCMethod->getDeclName();
- (void)dealloc { // expected-warning {{-dealloc is being overridden in a category}}
}
@end
+
+// rdar://15919775
+@interface NSObject @end
+@interface NSError:NSObject
+@end
+
+@interface NSError(CAT)
+- (NSError *)MCCopyAsPrimaryError __attribute__((objc_method_family(new)));
+@end
+@implementation NSError(CAT)
+- (NSError *)MCCopyAsPrimaryError {
+ return 0;
+}
+@end