summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-05 01:33:36 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-05 01:33:36 +0000
commitae580fede3b45b3777607e6961a8704b67eabe85 (patch)
treead2c36885b9417a71f780a9e444865b581948103 /clang/lib/AST/Decl.cpp
parent3b245876c0dae31939065497ac7b245fb725bb73 (diff)
downloadbcm5719-llvm-ae580fede3b45b3777607e6961a8704b67eabe85.tar.gz
bcm5719-llvm-ae580fede3b45b3777607e6961a8704b67eabe85.zip
Always start tag definitions before completing them. Assert same.
Fixes latent and not-so-latent objc++ and blocks++ bugs. llvm-svn: 95340
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index ba1def643e1..a23f28cb379 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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 &&
OpenPOWER on IntegriCloud