@@ -1488,18 +1488,19 @@ static void diagnoseIfDeprecated(SourceRange ReferenceRange,
14881488 if (!Attr)
14891489 return ;
14901490
1491+ auto Availability = Where.getAvailability ();
1492+
14911493 // We match the behavior of clang to not report deprecation warnings
14921494 // inside declarations that are themselves deprecated on all deployment
14931495 // targets.
1494- if (Where .isDeprecated ()) {
1496+ if (Availability .isDeprecated ()) {
14951497 return ;
14961498 }
14971499
14981500 auto *ReferenceDC = Where.getDeclContext ();
14991501 auto &Context = ReferenceDC->getASTContext ();
15001502 if (!Context.LangOpts .DisableAvailabilityChecking ) {
1501- AvailabilityRange RunningOSVersions = Where.getAvailabilityRange ();
1502- if (RunningOSVersions.isKnownUnreachable ()) {
1503+ if (Availability.getPlatformRange ().isKnownUnreachable ()) {
15031504 // Suppress a deprecation warning if the availability checking machinery
15041505 // thinks the reference program location will not execute on any
15051506 // deployment target for the current platform.
@@ -1567,18 +1568,19 @@ static bool diagnoseIfDeprecated(SourceLoc loc,
15671568 if (!attr)
15681569 return false ;
15691570
1571+ auto availability = where.getAvailability ();
1572+
15701573 // We match the behavior of clang to not report deprecation warnings
15711574 // inside declarations that are themselves deprecated on all deployment
15721575 // targets.
1573- if (where .isDeprecated ()) {
1576+ if (availability .isDeprecated ()) {
15741577 return false ;
15751578 }
15761579
15771580 auto *dc = where.getDeclContext ();
15781581 auto &ctx = dc->getASTContext ();
15791582 if (!ctx.LangOpts .DisableAvailabilityChecking ) {
1580- AvailabilityRange runningOSVersion = where.getAvailabilityRange ();
1581- if (runningOSVersion.isKnownUnreachable ()) {
1583+ if (availability.getPlatformRange ().isKnownUnreachable ()) {
15821584 // Suppress a deprecation warning if the availability checking machinery
15831585 // thinks the reference program location will not execute on any
15841586 // deployment target for the current platform.
0 commit comments