Skip to content

Commit 2bbebcb

Browse files
committed
[Sema] Remove invalid @_spi attributes
1 parent 2b5fc3a commit 2bbebcb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -867,11 +867,10 @@ void AttributeChecker::visitSPIAccessControlAttr(SPIAccessControlAttr *attr) {
867867
if (auto VD = dyn_cast<ValueDecl>(D)) {
868868
auto declAccess = VD->getFormalAccess();
869869
if (declAccess < AccessLevel::Public) {
870-
diagnose(attr->getLocation(),
871-
diag::spi_attribute_on_non_public,
872-
declAccess,
873-
D->getDescriptiveKind())
874-
.fixItRemove(attr->getRange());
870+
diagnoseAndRemoveAttr(attr,
871+
diag::spi_attribute_on_non_public,
872+
declAccess,
873+
D->getDescriptiveKind());
875874
}
876875
}
877876
}

0 commit comments

Comments
 (0)