Method implemented in class's implementation may implement

one declared in class's extension and not one declared
in class's superclass. This supresses a bogus warning on
method type mismatch.
Fixes //rdar: // 8530080

llvm-svn: 116118
This commit is contained in:
Fariborz Jahanian 2010-10-08 22:59:25 +00:00
parent bfde8dc627
commit 73853e5bab
2 changed files with 29 additions and 0 deletions

View File

@ -924,7 +924,16 @@ void Sema::MatchAllMethodDeclarations(const llvm::DenseSet<Selector> &InsMap,
WarnConflictingTypedMethods(ImpMethodDecl, IntfMethodDecl);
}
}
if (ObjCInterfaceDecl *I = dyn_cast<ObjCInterfaceDecl> (CDecl)) {
// Also methods in class extensions need be looked at next.
for (const ObjCCategoryDecl *ClsExtDecl = I->getFirstClassExtension();
ClsExtDecl; ClsExtDecl = ClsExtDecl->getNextClassExtension())
MatchAllMethodDeclarations(InsMap, ClsMap, InsMapSeen, ClsMapSeen,
IMPDecl,
const_cast<ObjCCategoryDecl *>(ClsExtDecl),
IncompleteImpl, false);
// Check for any implementation of a methods declared in protocol.
for (ObjCInterfaceDecl::all_protocol_iterator
PI = I->all_referenced_protocol_begin(),

View File

@ -0,0 +1,20 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// rdar://8530080
@protocol ViewDelegate @end
@interface NSTextView
- (id <ViewDelegate>)delegate;
@end
@interface FooTextView : NSTextView
@end
@interface FooTextView()
- (id)delegate;
@end
@implementation FooTextView
- (id)delegate {return 0; }
@end