From 13ee62f7d7eed3303f13374b25b8e51d38b2951b Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Wed, 20 Mar 2019 19:26:33 +0000 Subject: [Sema] Deduplicate some availability checking logic Before this commit, we emit unavailable errors for calls to functions during overload resolution, and for references to all other declarations in DiagnoseUseOfDecl. The early checks during overload resolution aren't as good as the DiagnoseAvailabilityOfDecl based checks, as they error on the code from PR40991. This commit fixes this by removing the early checking. llvm.org/PR40991 rdar://48564179 Differential revision: https://reviews.llvm.org/D59394 llvm-svn: 356599 --- clang/lib/Sema/SemaExprCXX.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/Sema/SemaExprCXX.cpp') diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 6e66b5e7020..ee096745532 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2338,8 +2338,7 @@ static bool resolveAllocationOverload( case OR_Deleted: { if (Diagnose) { S.Diag(R.getNameLoc(), diag::err_ovl_deleted_call) - << Best->Function->isDeleted() << R.getLookupName() - << S.getDeletedOrUnavailableSuffix(Best->Function) << Range; + << R.getLookupName() << Range; Candidates.NoteCandidates(S, OCD_AllCandidates, Args); } return true; @@ -3517,8 +3516,7 @@ static bool resolveBuiltinNewDeleteOverload(Sema &S, CallExpr *TheCall, case OR_Deleted: { S.Diag(R.getNameLoc(), diag::err_ovl_deleted_call) - << Best->Function->isDeleted() << R.getLookupName() - << S.getDeletedOrUnavailableSuffix(Best->Function) << Range; + << R.getLookupName() << Range; Candidates.NoteCandidates(S, OCD_AllCandidates, Args); return true; } -- cgit v1.2.3