Always start tag definitions before completing them. Assert same.
Fixes latent and not-so-latent objc++ and blocks++ bugs.
llvm-svn: 95340
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index b61ce8e..4c93513 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2902,6 +2902,7 @@
CFConstantStringTypeDecl =
CreateRecordDecl(*this, TagDecl::TK_struct, TUDecl, SourceLocation(),
&Idents.get("NSConstantString"));
+ CFConstantStringTypeDecl->startDefinition();
QualType FieldTypes[4];
@@ -2941,6 +2942,7 @@
ObjCFastEnumerationStateTypeDecl =
CreateRecordDecl(*this, TagDecl::TK_struct, TUDecl, SourceLocation(),
&Idents.get("__objcFastEnumerationState"));
+ ObjCFastEnumerationStateTypeDecl->startDefinition();
QualType FieldTypes[] = {
UnsignedLongTy,
@@ -2974,6 +2976,7 @@
// FIXME: Needs the FlagAppleBlock bit.
T = CreateRecordDecl(*this, TagDecl::TK_struct, TUDecl, SourceLocation(),
&Idents.get("__block_descriptor"));
+ T->startDefinition();
QualType FieldTypes[] = {
UnsignedLongTy,
@@ -3017,6 +3020,7 @@
// FIXME: Needs the FlagAppleBlock bit.
T = CreateRecordDecl(*this, TagDecl::TK_struct, TUDecl, SourceLocation(),
&Idents.get("__block_descriptor_withcopydispose"));
+ T->startDefinition();
QualType FieldTypes[] = {
UnsignedLongTy,
@@ -3137,6 +3141,7 @@
RecordDecl *T;
T = CreateRecordDecl(*this, TagDecl::TK_struct, TUDecl, SourceLocation(),
&Idents.get(Name.str()));
+ T->startDefinition();
QualType FieldTypes[] = {
getPointerType(VoidPtrTy),
IntTy,