@@ -744,14 +744,6 @@ TypeChecker::checkDeclarationAvailability(const Decl *D, SourceLoc referenceLoc,
744744 return UnavailabilityReason::requiresVersionRange (version);
745745}
746746
747- void TypeChecker::diagnosePotentialUnavailability (
748- const ValueDecl *D, SourceRange ReferenceRange,
749- const DeclContext *ReferenceDC,
750- const UnavailabilityReason &Reason) {
751- diagnosePotentialUnavailability (D, D->getName (), ReferenceRange,
752- ReferenceDC, Reason);
753- }
754-
755747// / A class that walks the AST to find the innermost (i.e., deepest) node that
756748// / contains a target SourceRange and matches a particular criterion.
757749// / This class finds the innermost nodes of interest by walking
@@ -1382,8 +1374,9 @@ void TypeChecker::diagnosePotentialOpaqueTypeUnavailability(
13821374}
13831375
13841376void TypeChecker::diagnosePotentialUnavailability (
1385- const Decl *D, DeclName Name, SourceRange ReferenceRange,
1386- const DeclContext *ReferenceDC, const UnavailabilityReason &Reason) {
1377+ const ValueDecl *D, SourceRange ReferenceRange,
1378+ const DeclContext *ReferenceDC,
1379+ const UnavailabilityReason &Reason) {
13871380 ASTContext &Context = ReferenceDC->getASTContext ();
13881381
13891382 // We only emit diagnostics for API unavailability, not for explicitly
@@ -1398,7 +1391,7 @@ void TypeChecker::diagnosePotentialUnavailability(
13981391 auto Err =
13991392 Context.Diags .diagnose (
14001393 ReferenceRange.Start , diag::availability_decl_only_version_newer,
1401- Name , prettyPlatformString (targetPlatform (Context.LangOpts )),
1394+ D-> getName () , prettyPlatformString (targetPlatform (Context.LangOpts )),
14021395 Reason.getRequiredOSVersionRange ().getLowerEndpoint ());
14031396
14041397 // Direct a fixit to the error if an existing guard is nearly-correct
0 commit comments