Added comment to Steve's patch to clarify the case.
llvm-svn: 61144
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 12c2245..a7e878f 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -369,6 +369,9 @@
///
FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
const ObjCIvarDecl *ivar) {
+ /* When a super class's ivar is referenced in the subclass method with no ivar
+ of its own, record for the sub-class is not built yet. Build it lazily
+ here. */
if (!RecordForDecl)
addRecordToClass(Context);
assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");