"bad receiver type %0")
DIAG(error_no_super_class, ERROR,
"no super class declared in @interface for %0")
+DIAG(error_no_super_class_message, ERROR,
+ "no @interface declaration found in class messaging of %0")
DIAG(error_missing_property_context, ERROR,
"missing context for property implementation declaration")
DIAG(error_bad_property_context, ERROR,
if (receiverName->isStr("super")) {
if (getCurMethodDecl()) {
isSuper = true;
- ClassDecl = getCurMethodDecl()->getClassInterface()->getSuperClass();
+ ObjCInterfaceDecl *OID = getCurMethodDecl()->getClassInterface();
+ if (!OID)
+ return Diag(lbrac, diag::error_no_super_class_message)
+ << getCurMethodDecl()->getDeclName();
+ ClassDecl = OID->getSuperClass();
if (!ClassDecl)
- return Diag(lbrac, diag::error_no_super_class)
- << getCurMethodDecl()->getClassInterface()->getDeclName();
+ return Diag(lbrac, diag::error_no_super_class) << OID->getDeclName();
if (getCurMethodDecl()->isInstance()) {
QualType superTy = Context.getObjCInterfaceType(ClassDecl);
superTy = Context.getPointerType(superTy);
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+@interface _Child
++ (int) flashCache;
+@end
+
+@interface Child (Categ) // expected-error {{cannot find interface declaration for 'Child'}}
++ (int) flushCache2;
+@end
+
+@implementation Child (Categ) // expected-error {{cannot find interface declaration for 'Child'}}
++ (int) flushCache2 { [super flashCache]; } // expected-error {{no @interface declaration found in class messaging of 'flushCache2'}}
+@end