3535#include " swift/Runtime/EnvironmentVariables.h"
3636#include " swift/Runtime/HeapObject.h"
3737#include " swift/Runtime/Heap.h"
38+ #include " swift/Runtime/STLCompatibility.h"
3839#include " swift/Threading/Mutex.h"
3940#include < atomic>
4041#include < new>
@@ -1059,8 +1060,6 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
10591060 // Initialize the parent context pointer to null.
10601061 initialContext->Parent = nullptr ;
10611062
1062- #pragma clang diagnostic push
1063- #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
10641063 // Initialize the resumption funclet pointer (async return address) to
10651064 // the final funclet for completing the task.
10661065
@@ -1074,21 +1073,20 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
10741073 // The final funclet shouldn't release the task or the task function.
10751074 } else if (asyncLet) {
10761075 initialContext->ResumeParent =
1077- reinterpret_cast <TaskContinuationFunction*>(&completeTask);
1076+ std::bit_cast <TaskContinuationFunction *>(&completeTask);
10781077
10791078 // If we have a non-null closure context and the task function is not
10801079 // consumed by calling it, use a final funclet that releases both the
10811080 // task and the closure context.
10821081 } else if (closureContext && !taskCreateFlags.isTaskFunctionConsumed ()) {
10831082 initialContext->ResumeParent =
1084- reinterpret_cast <TaskContinuationFunction*>(&completeTaskWithClosure);
1083+ std::bit_cast <TaskContinuationFunction *>(&completeTaskWithClosure);
10851084
10861085 // Otherwise, just release the task.
10871086 } else {
10881087 initialContext->ResumeParent =
1089- reinterpret_cast <TaskContinuationFunction*>(&completeTaskAndRelease);
1088+ std::bit_cast <TaskContinuationFunction *>(&completeTaskAndRelease);
10901089 }
1091- #pragma clang diagnostic pop
10921090
10931091 // Initialize the task-local allocator and our other private runtime
10941092 // state for the task.
0 commit comments