@@ -1455,8 +1455,8 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14551455 // allocation function.
14561456 ImplicitAllocationParameters IAP (
14571457 alignedAllocationModeFromBool (S.getLangOpts ().CoroAlignedAllocation ));
1458- auto LookupAllocationFunction = [&](Sema:: AllocationFunctionScope NewScope =
1459- Sema::AFS_Both ,
1458+ auto LookupAllocationFunction = [&](AllocationFunctionScope NewScope =
1459+ AllocationFunctionScope::Both ,
14601460 bool WithoutPlacementArgs = false ,
14611461 bool ForceNonAligned = false ) {
14621462 // [dcl.fct.def.coroutine]p9
@@ -1465,21 +1465,22 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
14651465 // - If any declarations are found, ...
14661466 // - If no declarations are found in the scope of the promise type, a search
14671467 // is performed in the global scope.
1468- if (NewScope == Sema::AFS_Both)
1469- NewScope = PromiseContainsNew ? Sema::AFS_Class : Sema::AFS_Global;
1468+ if (NewScope == AllocationFunctionScope::Both)
1469+ NewScope = PromiseContainsNew ? AllocationFunctionScope::Class
1470+ : AllocationFunctionScope::Global;
14701471
14711472 bool ShouldUseAlignedAlloc =
14721473 !ForceNonAligned && S.getLangOpts ().CoroAlignedAllocation ;
14731474 IAP = ImplicitAllocationParameters (
14741475 alignedAllocationModeFromBool (ShouldUseAlignedAlloc));
14751476
14761477 FunctionDecl *UnusedResult = nullptr ;
1477- S.FindAllocationFunctions (Loc, SourceRange (), NewScope,
1478- /* DeleteScope= */ Sema::AFS_Both, PromiseType ,
1479- /* isArray =*/ false , IAP ,
1480- WithoutPlacementArgs ? MultiExprArg{}
1481- : PlacementArgs,
1482- OperatorNew, UnusedResult, /* Diagnose=*/ false );
1478+ S.FindAllocationFunctions (
1479+ Loc, SourceRange (), NewScope ,
1480+ /* DeleteScope =*/ AllocationFunctionScope::Both, PromiseType ,
1481+ /* isArray= */ false , IAP,
1482+ WithoutPlacementArgs ? MultiExprArg{} : PlacementArgs, OperatorNew ,
1483+ UnusedResult, /* Diagnose=*/ false );
14831484 assert (!OperatorNew || !OperatorNew->isTypeAwareOperatorNewOrDelete ());
14841485 };
14851486
@@ -1506,7 +1507,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
15061507 // an argument of type std:align_val_t as the second argument.
15071508 if (!OperatorNew || (S.getLangOpts ().CoroAlignedAllocation &&
15081509 !isAlignedAllocation (IAP.PassAlignment )))
1509- LookupAllocationFunction (/* NewScope*/ Sema::AFS_Class ,
1510+ LookupAllocationFunction (/* NewScope*/ AllocationFunctionScope::Class ,
15101511 /* WithoutPlacementArgs*/ true );
15111512 }
15121513
@@ -1533,12 +1534,12 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
15331534 if (!OperatorNew || !isAlignedAllocation (IAP.PassAlignment )) {
15341535 FoundNonAlignedInPromise = OperatorNew;
15351536
1536- LookupAllocationFunction (/* NewScope*/ Sema::AFS_Class ,
1537+ LookupAllocationFunction (/* NewScope*/ AllocationFunctionScope::Class ,
15371538 /* WithoutPlacementArgs*/ false ,
15381539 /* ForceNonAligned*/ true );
15391540
15401541 if (!OperatorNew && !PlacementArgs.empty ())
1541- LookupAllocationFunction (/* NewScope*/ Sema::AFS_Class ,
1542+ LookupAllocationFunction (/* NewScope*/ AllocationFunctionScope::Class ,
15421543 /* WithoutPlacementArgs*/ true ,
15431544 /* ForceNonAligned*/ true );
15441545 }
@@ -1554,7 +1555,7 @@ bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {
15541555 return false ;
15551556 PlacementArgs = {StdNoThrow};
15561557 OperatorNew = nullptr ;
1557- LookupAllocationFunction (Sema::AFS_Global );
1558+ LookupAllocationFunction (AllocationFunctionScope::Global );
15581559 }
15591560
15601561 // If we found a non-aligned allocation function in the promise_type,
0 commit comments