ABIChecker: don't diagnose missing availability attribute for decls where the attribute doesn't apply

rdar://62990671
This commit is contained in:
Xi Ge
2020-05-11 08:35:09 -07:00
parent 13cb4a434c
commit 9883e664b2
3 changed files with 5 additions and 3 deletions

View File

@@ -1145,6 +1145,8 @@ public:
// Decls with @_alwaysEmitIntoClient aren't required to have an
// @available attribute.
if (!Ctx.getOpts().SkipOSCheck &&
DeclAttribute::canAttributeAppearOnDeclKind(DeclAttrKind::DAK_Available,
D->getDeclKind()) &&
!D->getIntroducingVersion().hasOSAvailability() &&
!D->hasDeclAttribute(DeclAttrKind::DAK_AlwaysEmitIntoClient)) {
D->emitDiag(D->getLoc(), diag::new_decl_without_intro);