r197850 - Assert that tag decls are never marked (in)valid after definition is complete

Alp Toker alp at nuanti.com
Fri Dec 20 17:10:54 PST 2013


Author: alp
Date: Fri Dec 20 19:10:54 2013
New Revision: 197850

URL: http://llvm.org/viewvc/llvm-project?rev=197850&view=rev
Log:
Assert that tag decls are never marked (in)valid after definition is complete

Sema relies on this assumption.

Follow-up to r197848.

Modified:
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=197850&r1=197849&r2=197850&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Fri Dec 20 19:10:54 2013
@@ -85,6 +85,7 @@ const char *Decl::getDeclKindName() cons
 
 void Decl::setInvalidDecl(bool Invalid) {
   InvalidDecl = Invalid;
+  assert(!isa<TagDecl>(this) || !cast<TagDecl>(this)->isCompleteDefinition());
   if (Invalid && !isa<ParmVarDecl>(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"





More information about the cfe-commits mailing list