Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
- I don't know how to make a test case for this, but this strengthens
the invariants that hold internally. The functionality change here
is the edit to SemaDeclObjC.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 9cc2291..5df5ff3 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -381,6 +381,7 @@
const FieldDecl *
ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context,
const ObjCIvarDecl *IVar) const {
+ assert(!isForwardDecl() && "Invalid interface decl!");
const RecordDecl *RecordForDecl = Context.addRecordToClass(this);
assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");
DeclContext::lookup_const_result Lookup =