summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-17 00:38:33 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-17 00:38:33 +0000
commit2ff380a43a1718ad961cef957d3b1d21bea18e69 (patch)
tree28e5615abf3f4c28a737f43516f737b04a0b8d4d /clang/lib/Sema/SemaDecl.cpp
parent81dfb30e4c85f4b779a2cc75fedebeff2b9f89ae (diff)
downloadbcm5719-llvm-2ff380a43a1718ad961cef957d3b1d21bea18e69.tar.gz
bcm5719-llvm-2ff380a43a1718ad961cef957d3b1d21bea18e69.zip
Clean up after ourselves when there's an error parsing the base clause.
Fixes the crash-on-invalid in PR6629. llvm-svn: 98698
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5db817192f6..f4b9cf4cdeb 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5118,6 +5118,18 @@ void Sema::ActOnTagFinishDefinition(Scope *S, DeclPtrTy TagD,
Consumer.HandleTagDeclDefinition(Tag);
}
+void Sema::ActOnTagDefinitionError(Scope *S, DeclPtrTy TagD) {
+ AdjustDeclIfTemplate(TagD);
+ TagDecl *Tag = cast<TagDecl>(TagD.getAs<Decl>());
+
+ Tag->setInvalidDecl();
+
+ if (isa<CXXRecordDecl>(Tag))
+ FieldCollector->FinishClass();
+
+ PopDeclContext();
+}
+
// Note that FieldName may be null for anonymous bitfields.
bool Sema::VerifyBitField(SourceLocation FieldLoc, IdentifierInfo *FieldName,
QualType FieldTy, const Expr *BitWidth,
OpenPOWER on IntegriCloud