From: Alp Toker Date: Sat, 21 Dec 2013 01:10:54 +0000 (+0000) Subject: Assert that tag decls are never marked (in)valid after definition is complete X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4050e7ed39b85c5781fb60677159d04da4d63285;p=clang Assert that tag decls are never marked (in)valid after definition is complete Sema relies on this assumption. Follow-up to r197848. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197850 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 4eceda4fac..8e7373631d 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -85,6 +85,7 @@ const char *Decl::getDeclKindName() const { void Decl::setInvalidDecl(bool Invalid) { InvalidDecl = Invalid; + assert(!isa(this) || !cast(this)->isCompleteDefinition()); if (Invalid && !isa(this)) { // Defensive maneuver for ill-formed code: we're likely not to make it to // a point where we set the access specifier, so default it to "public"