objective-c: don't involve properties when checking

under -Wsuper-class-method-mismatch for method
mismatches in current and suprt class.
// rdar://11793793

llvm-svn: 159784
This commit is contained in:
Fariborz Jahanian 2012-07-05 22:26:07 +00:00
parent 13b92929dc
commit 31a2568096
2 changed files with 22 additions and 1 deletions

View File

@ -2700,7 +2700,8 @@ void Sema::CheckObjCMethodOverrides(ObjCMethodDecl *ObjCMethod,
isa<ObjCProtocolDecl>(overridden->getDeclContext()));
if (CurrentClass && overridden->getDeclContext() != CurrentClass &&
isa<ObjCInterfaceDecl>(overridden->getDeclContext())) {
isa<ObjCInterfaceDecl>(overridden->getDeclContext()) &&
!overridden->isImplicit() /* not meant for properties */) {
ObjCMethodDecl::param_iterator ParamI = ObjCMethod->param_begin(),
E = ObjCMethod->param_end();
ObjCMethodDecl::param_iterator PrevI = overridden->param_begin(),

View File

@ -0,0 +1,20 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -Wsuper-class-method-mismatch -verify %s
// rdar://11793793
@class NSString;
@interface Super
@property (nonatomic) NSString *thingy;
@property () __weak id PROP;
@end
@interface Sub : Super
@end
@implementation Sub
- (void)setThingy:(NSString *)val
{
[super setThingy:val];
}
@synthesize PROP;
@end