Index: lib/Sema/SemaExprMember.cpp =================================================================== --- lib/Sema/SemaExprMember.cpp +++ lib/Sema/SemaExprMember.cpp @@ -1568,6 +1568,9 @@ // Also must look for a getter name which uses property syntax. Selector Sel = S.PP.getSelectorTable().getNullarySelector(Member); ObjCInterfaceDecl *IFace = MD->getClassInterface(); + if (!IFace) + goto fail; + ObjCMethodDecl *Getter; if ((Getter = IFace->lookupClassMethod(Sel))) { // Check the use of this method. Index: test/SemaObjC/undef-class-property-error.m =================================================================== --- /dev/null +++ test/SemaObjC/undef-class-property-error.m @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +@implementation I (C) // expected-error {{cannot find interface declaration for 'I'}} + ++ (void)f { + self.m; // expected-error {{member reference base type 'Class' is not a structure or union}} +} + +@end