@@ -1112,10 +1112,9 @@ static bool findDeleteForPromise(Sema &S, SourceLocation Loc, QualType PromiseTy
11121112 // The deallocation function's name is looked up by searching for it in the
11131113 // scope of the promise type. If nothing is found, a search is performed in
11141114 // the global scope.
1115- ImplicitDeallocationParameters IDP = {.PassTypeIdentity =
1116- S.AllowTypeAwareAllocators (),
1117- .PassAlignment = Overaligned,
1118- .PassSize = true };
1115+ ImplicitDeallocationParameters IDP = {
1116+ typeAwareAllocation (S.AllowTypeAwareAllocators ()),
1117+ alignedAllocation (Overaligned), SizedDeallocation::Yes};
11191118 if (S.FindDeallocationFunction (Loc, PointeeRD, DeleteName, OperatorDelete,
11201119 PromiseType, IDP, /* Diagnose*/ true ))
11211120 return false ;
@@ -1133,7 +1132,8 @@ static bool findDeleteForPromise(Sema &S, SourceLocation Loc, QualType PromiseTy
11331132 // Sema::FindUsualDeallocationFunction will try to find the one with two
11341133 // parameters first. It will return the deallocation function with one
11351134 // parameter if failed.
1136- IDP.PassSize = CanProvideSize;
1135+ IDP.PassSize =
1136+ CanProvideSize ? SizedDeallocation::Yes : SizedDeallocation::No;
11371137 OperatorDelete =
11381138 S.FindUsualDeallocationFunction (PromiseType, Loc, IDP, DeleteName);
11391139
@@ -1426,8 +1426,8 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14261426 // Helper function to indicate whether the last lookup found the aligned
14271427 // allocation function.
14281428 ImplicitAllocationParameters IAP = {
1429- . PassTypeIdentity = S.AllowTypeAwareAllocators (),
1430- . PassAlignment = S.getLangOpts ().CoroAlignedAllocation != 0 };
1429+ typeAwareAllocation ( S.AllowTypeAwareAllocators () ),
1430+ alignedAllocation ( S.getLangOpts ().CoroAlignedAllocation ) };
14311431 auto LookupAllocationFunction =
14321432 [&](Sema::AllocationFunctionScope NewScope = Sema::AFS_Both,
14331433 bool WithoutPlacementArgs = false , bool ForceNonAligned = false ) {
@@ -1442,9 +1442,9 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14421442 if (NewScope == Sema::AFS_Both)
14431443 NewScope = PromiseContainsNew ? Sema::AFS_Class : Sema::AFS_Global;
14441444
1445- IAP = {. PassTypeIdentity = S.AllowTypeAwareAllocators (),
1446- . PassAlignment =
1447- !ForceNonAligned && S.getLangOpts ().CoroAlignedAllocation };
1445+ IAP = {typeAwareAllocation ( S.AllowTypeAwareAllocators () ),
1446+ alignedAllocation (!ForceNonAligned &&
1447+ S.getLangOpts ().CoroAlignedAllocation ) };
14481448
14491449 FunctionDecl *UnusedResult = nullptr ;
14501450
@@ -1478,7 +1478,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14781478 // std::size_t as the first argument, and the requested alignment as
14791479 // an argument of type std:align_val_t as the second argument.
14801480 if (!OperatorNew ||
1481- (S.getLangOpts ().CoroAlignedAllocation && !IAP.PassAlignment ))
1481+ (S.getLangOpts ().CoroAlignedAllocation && !IAP.passAlignment () ))
14821482 LookupAllocationFunction (/* NewScope*/ Sema::AFS_Class,
14831483 /* WithoutPlacementArgs*/ true );
14841484 }
@@ -1503,7 +1503,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
15031503 // Helper variable to emit warnings.
15041504 bool FoundNonAlignedInPromise = false ;
15051505 if (PromiseContainsNew && S.getLangOpts ().CoroAlignedAllocation )
1506- if (!OperatorNew || !IAP.PassAlignment ) {
1506+ if (!OperatorNew || !IAP.passAlignment () ) {
15071507 FoundNonAlignedInPromise = OperatorNew;
15081508
15091509 LookupAllocationFunction (/* NewScope*/ Sema::AFS_Class,
@@ -1598,7 +1598,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
15981598 return false ;
15991599
16001600 SmallVector<Expr *, 3 > NewArgs;
1601- if (IAP.PassTypeIdentity ) {
1601+ if (IAP.passTypeIdentity () ) {
16021602 std::optional<QualType> SpecializedTypeIdentity =
16031603 S.instantiateSpecializedTypeIdentity (PromiseType);
16041604 if (!SpecializedTypeIdentity)
@@ -1612,7 +1612,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
16121612 NewArgs.push_back (TypeIdentity.get ());
16131613 }
16141614 NewArgs.push_back (FrameSize);
1615- if (S.getLangOpts ().CoroAlignedAllocation && IAP.PassAlignment )
1615+ if (S.getLangOpts ().CoroAlignedAllocation && IAP.passAlignment () )
16161616 NewArgs.push_back (FrameAlignment);
16171617
16181618 if (OperatorNew->getNumParams () > NewArgs.size ())
0 commit comments