Always start tag definitions before completing them.  Assert same.

Fixes latent and not-so-latent objc++ and blocks++ bugs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95340 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index ba1def6..a23f28c 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1386,6 +1386,10 @@
 }
 
 void TagDecl::completeDefinition() {
+  assert((!isa<CXXRecordDecl>(this) ||
+          cast<CXXRecordDecl>(this)->hasDefinition()) &&
+         "definition completed but not started");
+
   IsDefinition = true;
   if (TagType *TagT = const_cast<TagType *>(TypeForDecl->getAs<TagType>())) {
     assert(TagT->decl.getPointer() == this &&