forked from OSchip/llvm-project
Objective-C. Fixes a bug where "new" family attribute
was not being overridden in the category method implementation resulting in bogus warning. // rdar://15919775 llvm-svn: 200342
This commit is contained in:
parent
7523743075
commit
f40ef45c9d
|
@ -3165,7 +3165,8 @@ Decl *Sema::ActOnMethodDeclaration(
|
|||
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();
|
||||
|
|
|
@ -39,3 +39,17 @@
|
|||
- (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
|
||||
|
|
Loading…
Reference in New Issue