Index: lib/AST/DeclBase.cpp =================================================================== --- lib/AST/DeclBase.cpp +++ lib/AST/DeclBase.cpp @@ -131,11 +131,12 @@ void Decl::setInvalidDecl(bool Invalid) { InvalidDecl = Invalid; - assert(!isa(this) || !cast(this)->isCompleteDefinition()); if (!Invalid) { return; } + assert(!isa(this) || !cast(this)->isCompleteDefinition()); + if (!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"