diff options
author | John McCall <rjmccall@apple.com> | 2010-02-05 01:33:36 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-05 01:33:36 +0000 |
commit | 5cfa011e61e14e6f2e1659047d809706c0e4c6a3 (patch) | |
tree | 76f49243d44cdc882a04f7ecf13fff34f0694712 /lib/AST/Decl.cpp | |
parent | 82287d19ded35248c4ce6a425ce74116a13ce44e (diff) |
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
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index ba1def643e..a23f28cb37 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1386,6 +1386,10 @@ void TagDecl::startDefinition() { } 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 && |