SourceLocation EndProtoLoc) {
ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
- /// Check that class of this category is already completely declared.
- if (!IDecl || IDecl->isForwardDecl()) {
- Diag(ClassLoc, diag::err_undef_interface, ClassName->getName());
- return 0;
- }
ObjCCategoryDecl *CDecl = new ObjCCategoryDecl(AtInterfaceLoc, NumProtoRefs,
CategoryName);
CDecl->setClassInterface(IDecl);
- /// Check for duplicate interface declaration for this category
- ObjCCategoryDecl *CDeclChain;
- for (CDeclChain = IDecl->getCategoryList(); CDeclChain;
- CDeclChain = CDeclChain->getNextClassCategory()) {
- if (CDeclChain->getIdentifier() == CategoryName) {
- Diag(CategoryLoc, diag::err_dup_category_def, ClassName->getName(),
- CategoryName->getName());
- break;
+
+ /// Check that class of this category is already completely declared.
+ if (!IDecl || IDecl->isForwardDecl())
+ Diag(ClassLoc, diag::err_undef_interface, ClassName->getName());
+ else {
+ /// Check for duplicate interface declaration for this category
+ ObjCCategoryDecl *CDeclChain;
+ for (CDeclChain = IDecl->getCategoryList(); CDeclChain;
+ CDeclChain = CDeclChain->getNextClassCategory()) {
+ if (CDeclChain->getIdentifier() == CategoryName) {
+ Diag(CategoryLoc, diag::err_dup_category_def, ClassName->getName(),
+ CategoryName->getName());
+ break;
+ }
}
- }
if (!CDeclChain)
CDecl->insertNextClassCategory();
+ }
if (NumProtoRefs) {
/// Check then save referenced protocols
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__));
+static __inline__ int __inline_isfinitef (float ) __attribute__ ((always_inline));
+
+@interface NSATSTypesetter (NSPantherCompatibility) // expected-error {{ "cannot find interface declaration for 'NSATSTypesetter'" }}
+- (id)lineFragmentRectForProposedRect:(id)proposedRect remainingRect:(id)remainingRect __attribute__((deprecated));
+@end