@@ -1754,7 +1754,7 @@ static bool isNonPlacementDeallocationFunction(Sema &S, FunctionDecl *FD) {
17541754 return false ;
17551755
17561756 unsigned UsualParams = 1 ;
1757- if (S.AllowTypeAwareAllocators () && UsualParams < FD->getNumParams () &&
1757+ if (S.AllowTypeAwareAllocatorsInCurrentContext () && UsualParams < FD->getNumParams () &&
17581758 S.isTypeAwareOperatorNewOrDelete (FD))
17591759 ++UsualParams;
17601760
@@ -1795,7 +1795,7 @@ namespace {
17951795 FD = *InstantiatedDecl;
17961796 }
17971797 unsigned NumBaseParams = 1 ;
1798- if (S.AllowTypeAwareAllocators () &&
1798+ if (S.AllowTypeAwareAllocatorsInCurrentContext () &&
17991799 S.isTypeAwareOperatorNewOrDelete (FD)) {
18001800 QualType TypeIdentityTag = FD->getParamDecl (0 )->getType ();
18011801 std::optional<QualType> ExpectedTypeIdentityTag =
@@ -2432,7 +2432,7 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
24322432 AllocType->isDependentType () ? 0 : Context.getTypeAlign (AllocType);
24332433 unsigned NewAlignment = Context.getTargetInfo ().getNewAlign ();
24342434 ImplicitAllocationParameters IAP = {
2435- typeAwareAllocation (AllowTypeAwareAllocators ()),
2435+ typeAwareAllocation (AllowTypeAwareAllocatorsInCurrentContext ()),
24362436 alignedAllocation (getLangOpts ().AlignedAllocation &&
24372437 Alignment > NewAlignment)};
24382438
@@ -3509,7 +3509,7 @@ FunctionDecl *Sema::FindUsualDeallocationFunction(
35093509 DeclareGlobalNewDelete ();
35103510
35113511 LookupResult FoundDelete (*this , Name, StartLoc, LookupOrdinaryName);
3512- DeallocLookupMode LookupMode = AllowTypeAwareAllocators ()
3512+ DeallocLookupMode LookupMode = AllowTypeAwareAllocatorsInCurrentContext ()
35133513 ? DeallocLookupMode::OptionallyTyped
35143514 : DeallocLookupMode::Untyped;
35153515 LookupGlobalDeallocationFunctions (*this , StartLoc, FoundDelete, LookupMode,
@@ -3540,7 +3540,7 @@ FunctionDecl *Sema::FindDeallocationFunctionForDestructor(SourceLocation Loc,
35403540 FunctionDecl *OperatorDelete = nullptr ;
35413541 QualType DeallocType = Context.getRecordType (RD);
35423542 ImplicitDeallocationParameters IDP = {
3543- typeAwareAllocation (AllowTypeAwareAllocators ()), AlignedAllocation::No,
3543+ typeAwareAllocation (AllowTypeAwareAllocatorsInCurrentContext ()), AlignedAllocation::No,
35443544 SizedDeallocation::No};
35453545
35463546 if (FindDeallocationFunction (Loc, RD, Name, OperatorDelete, DeallocType, IDP))
@@ -4012,7 +4012,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
40124012
40134013 if (PointeeRD) {
40144014 ImplicitDeallocationParameters IDP = {
4015- typeAwareAllocation (AllowTypeAwareAllocators ()),
4015+ typeAwareAllocation (AllowTypeAwareAllocatorsInCurrentContext ()),
40164016 AlignedAllocation::No, SizedDeallocation::No};
40174017 if (!UseGlobal &&
40184018 FindDeallocationFunction (StartLoc, PointeeRD, DeleteName,
@@ -4066,7 +4066,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
40664066
40674067 // Look for a global declaration.
40684068 ImplicitDeallocationParameters IDP = {
4069- typeAwareAllocation (AllowTypeAwareAllocators ()),
4069+ typeAwareAllocation (AllowTypeAwareAllocatorsInCurrentContext ()),
40704070 alignedAllocation (Overaligned), sizedDeallocation (CanProvideSize)};
40714071 OperatorDelete =
40724072 FindUsualDeallocationFunction (Pointee, StartLoc, IDP, DeleteName);
0 commit comments