This was a recent regression caused by r61043 (related to code gen. for ivar references).
Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61134
91177308-0d34-0410-b5e6-
96231b3b80d8
///
FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
const ObjCIvarDecl *ivar) {
+ if (!RecordForDecl)
+ addRecordToClass(Context);
assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");
DeclarationName Member = ivar->getDeclName();
DeclContext::lookup_result Lookup = RecordForDecl->lookup(Context, Member);
--- /dev/null
+// RUN: clang %s -fsyntax-only -verify
+@interface A
+{
+ int ivar;
+}
+@end
+
+@interface B : A
+- (int)ivar;
+@end
+
+@implementation B
+- (int)ivar {
+ return ivar;
+}
+@end