Skip to content

Commit 1ab9e45

Browse files
author
Brian King
committed
Remove the final attribute instead of invalidating it to ensure that child decls pass the ASTVerifier
1 parent 29c1fc4 commit 1ab9e45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ class AttributeEarlyChecker : public AttributeVisitor<AttributeEarlyChecker> {
194194
TC.diagnose(attr->getLocation(), diag::member_cannot_be_final)
195195
.fixItRemove(attr->getRange());
196196

197-
// Invalidate the attribute so child declarations are not flagged as final
197+
// Remove the attribute so child declarations are not flagged as final
198198
// and duplicate the error message.
199-
attr->setInvalid();
199+
D->getAttrs().removeAttribute(attr);
200200
return;
201201
}
202202
}

0 commit comments

Comments
 (0)