bool& IncompleteImpl,
const llvm::DenseSet<Selector> &InsMap,
const llvm::DenseSet<Selector> &ClsMap,
- ObjCInterfaceDecl *IDecl);
+ ObjCContainerDecl *CDecl);
/// CheckImplementationIvars - This routine checks if the instance variables
/// listed in the implelementation match those listed in the interface.
bool& IncompleteImpl,
const llvm::DenseSet<Selector> &InsMap,
const llvm::DenseSet<Selector> &ClsMap,
- ObjCInterfaceDecl *IDecl) {
+ ObjCContainerDecl *CDecl) {
+ ObjCInterfaceDecl *IDecl;
+ if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(CDecl))
+ IDecl = C->getClassInterface();
+ else
+ IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl);
+ assert (IDecl && "CheckProtocolMethodDefs - IDecl is null");
+
ObjCInterfaceDecl *Super = IDecl->getSuperClass();
ObjCInterfaceDecl *NSIDecl = 0;
if (getLangOptions().NeXTRuntime) {
IDecl->lookupInstanceMethod(method->getSelector());
if (!MethodInClass || !MethodInClass->isSynthesized()) {
WarnUndefinedMethod(ImpLoc, method, IncompleteImpl);
- Diag(IDecl->getLocation(), diag::note_required_for_protocol_at) <<
+ Diag(CDecl->getLocation(), diag::note_required_for_protocol_at) <<
PDecl->getDeclName();
}
}
for (ObjCCategoryDecl::protocol_iterator PI = C->protocol_begin(),
E = C->protocol_end(); PI != E; ++PI)
CheckProtocolMethodDefs(IMPDecl->getLocation(), *PI, IncompleteImpl,
- InsMap, ClsMap, C->getClassInterface());
+ InsMap, ClsMap, CDecl);
// Report unimplemented properties in the category as well.
// When reporting on missing setter/getters, do not report when
// setter/getter is implemented in category's primary class
// RUN: %clang_cc1 -fsyntax-only -verify %s
-@interface MyClass1 // expected-note 2 {{required for direct or indirect protocol 'P'}}
+@interface MyClass1
@end
@protocol P
- (void) Pmeth1; // expected-note {{method definition for 'Pmeth1' not found}}
@end
-@interface MyClass1(CAT) <P>
+@interface MyClass1(CAT) <P> // expected-note {{required for direct or indirect protocol 'P'}}
- (void) meth2; // expected-note {{method definition for 'meth2' not found}}
@end
- (void) Pmeth1{}
@end
-@interface MyClass1(DOG) <P>
+@interface MyClass1(DOG) <P> // expected-note {{required for direct or indirect protocol 'P'}}
- (void)ppp; // expected-note {{method definition for 'ppp' not found}}
@end