Skip to content
Snippets Groups Projects
Commit 4050e7ed authored by Alp Toker's avatar Alp Toker
Browse files

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
parent 573f9a11
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,7 @@ const char *Decl::getDeclKindName() const {
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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment