Keep track when a ObjC interface/protocol was initially created as a forward reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142230 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 62b4a7c..1de17d2 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -597,7 +597,8 @@
PDecl->setChangedSinceDeserialization(true);
} else {
PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
- ProtocolLoc, AtProtoInterfaceLoc);
+ ProtocolLoc, AtProtoInterfaceLoc,
+ /*isForwardDecl=*/false);
PushOnScopeChains(PDecl, TUScope);
PDecl->setForwardDecl(false);
}
@@ -698,7 +699,8 @@
bool isNew = false;
if (PDecl == 0) { // Not already seen?
PDecl = ObjCProtocolDecl::Create(Context, CurContext, Ident,
- IdentList[i].second, AtProtocolLoc);
+ IdentList[i].second, AtProtocolLoc,
+ /*isForwardDecl=*/true);
PushOnScopeChains(PDecl, TUScope, false);
isNew = true;
}