@@ -1488,18 +1488,19 @@ static void diagnoseIfDeprecated(SourceRange ReferenceRange,
1488
1488
if (!Attr)
1489
1489
return ;
1490
1490
1491
+ auto Availability = Where.getAvailability ();
1492
+
1491
1493
// We match the behavior of clang to not report deprecation warnings
1492
1494
// inside declarations that are themselves deprecated on all deployment
1493
1495
// targets.
1494
- if (Where .isDeprecated ()) {
1496
+ if (Availability .isDeprecated ()) {
1495
1497
return ;
1496
1498
}
1497
1499
1498
1500
auto *ReferenceDC = Where.getDeclContext ();
1499
1501
auto &Context = ReferenceDC->getASTContext ();
1500
1502
if (!Context.LangOpts .DisableAvailabilityChecking ) {
1501
- AvailabilityRange RunningOSVersions = Where.getAvailabilityRange ();
1502
- if (RunningOSVersions.isKnownUnreachable ()) {
1503
+ if (Availability.getPlatformRange ().isKnownUnreachable ()) {
1503
1504
// Suppress a deprecation warning if the availability checking machinery
1504
1505
// thinks the reference program location will not execute on any
1505
1506
// deployment target for the current platform.
@@ -1567,18 +1568,19 @@ static bool diagnoseIfDeprecated(SourceLoc loc,
1567
1568
if (!attr)
1568
1569
return false ;
1569
1570
1571
+ auto availability = where.getAvailability ();
1572
+
1570
1573
// We match the behavior of clang to not report deprecation warnings
1571
1574
// inside declarations that are themselves deprecated on all deployment
1572
1575
// targets.
1573
- if (where .isDeprecated ()) {
1576
+ if (availability .isDeprecated ()) {
1574
1577
return false ;
1575
1578
}
1576
1579
1577
1580
auto *dc = where.getDeclContext ();
1578
1581
auto &ctx = dc->getASTContext ();
1579
1582
if (!ctx.LangOpts .DisableAvailabilityChecking ) {
1580
- AvailabilityRange runningOSVersion = where.getAvailabilityRange ();
1581
- if (runningOSVersion.isKnownUnreachable ()) {
1583
+ if (availability.getPlatformRange ().isKnownUnreachable ()) {
1582
1584
// Suppress a deprecation warning if the availability checking machinery
1583
1585
// thinks the reference program location will not execute on any
1584
1586
// deployment target for the current platform.
0 commit comments