}
if (ProtocolRefs.empty())
return;
-
+ // Merge ProtocolRefs into class's protocol list;
for (protocol_iterator p = protocol_begin(), e = protocol_end();
p != e; p++)
ProtocolRefs.push_back(*p);
ReferencedProtocols.Destroy(C);
unsigned NumProtoRefs = ProtocolRefs.size();
setProtocolList((ObjCProtocolDecl**)&ProtocolRefs[0], NumProtoRefs, C);
- // Merge ProtocolRefs into class's protocol list;
-
}
ObjCIvarDecl *ObjCInterfaceDecl::lookupInstanceVariable(IdentifierInfo *ID,
CDecl->insertNextClassCategory();
if (NumProtoRefs) {
+ CDecl->setProtocolList((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs,
+ Context);
+ CDecl->setLocEnd(EndProtoLoc);
// Protocols in the class extension belong to the class.
if (!CDecl->getIdentifier())
IDecl->mergeClassExtensionProtocolList((ObjCProtocolDecl**)ProtoRefs,
NumProtoRefs,Context);
- else {
- CDecl->setProtocolList((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs,
- Context);
- CDecl->setLocEnd(EndProtoLoc);
- }
}
CheckObjCDeclScope(CDecl);
}
}
} else if (ObjCCategoryDecl *C = dyn_cast<ObjCCategoryDecl>(CDecl)) {
- for (ObjCCategoryDecl::protocol_iterator PI = C->protocol_begin(),
- E = C->protocol_end(); PI != E; ++PI)
- CheckProtocolMethodDefs(IMPDecl->getLocation(), *PI, IncompleteImpl,
- InsMap, ClsMap, C->getClassInterface());
+ // For extended class, unimplemented methods in its protocols will
+ // be reported in the primary class.
+ if (C->getIdentifier()) {
+ for (ObjCCategoryDecl::protocol_iterator PI = C->protocol_begin(),
+ E = C->protocol_end(); PI != E; ++PI)
+ CheckProtocolMethodDefs(IMPDecl->getLocation(), *PI, IncompleteImpl,
+ InsMap, ClsMap, C->getClassInterface());
+ }
} else
assert(false && "invalid ObjCContainerDecl type.");
}