3535#include " swift/Runtime/EnvironmentVariables.h"
3636#include " swift/Runtime/HeapObject.h"
3737#include " swift/Runtime/Heap.h"
38- #include " swift/Runtime/STLCompatibility.h"
3938#include " swift/Threading/Mutex.h"
4039#include < atomic>
4140#include < new>
@@ -1059,6 +1058,8 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
10591058 // Initialize the parent context pointer to null.
10601059 initialContext->Parent = nullptr ;
10611060
1061+ #pragma clang diagnostic push
1062+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
10621063 // Initialize the resumption funclet pointer (async return address) to
10631064 // the final funclet for completing the task.
10641065
@@ -1072,20 +1073,21 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
10721073 // The final funclet shouldn't release the task or the task function.
10731074 } else if (asyncLet) {
10741075 initialContext->ResumeParent =
1075- std::bit_cast <TaskContinuationFunction *>(&completeTask);
1076+ reinterpret_cast <TaskContinuationFunction*>(&completeTask);
10761077
10771078 // If we have a non-null closure context and the task function is not
10781079 // consumed by calling it, use a final funclet that releases both the
10791080 // task and the closure context.
10801081 } else if (closureContext && !taskCreateFlags.isTaskFunctionConsumed ()) {
10811082 initialContext->ResumeParent =
1082- std::bit_cast <TaskContinuationFunction *>(&completeTaskWithClosure);
1083+ reinterpret_cast <TaskContinuationFunction*>(&completeTaskWithClosure);
10831084
10841085 // Otherwise, just release the task.
10851086 } else {
10861087 initialContext->ResumeParent =
1087- std::bit_cast <TaskContinuationFunction *>(&completeTaskAndRelease);
1088+ reinterpret_cast <TaskContinuationFunction*>(&completeTaskAndRelease);
10881089 }
1090+ #pragma clang diagnostic pop
10891091
10901092 // Initialize the task-local allocator and our other private runtime
10911093 // state for the task.
0 commit comments