35
35
#include " swift/Runtime/EnvironmentVariables.h"
36
36
#include " swift/Runtime/HeapObject.h"
37
37
#include " swift/Runtime/Heap.h"
38
- #include " swift/Runtime/STLCompatibility.h"
39
38
#include " swift/Threading/Mutex.h"
40
39
#include < atomic>
41
40
#include < new>
@@ -1059,6 +1058,8 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
1059
1058
// Initialize the parent context pointer to null.
1060
1059
initialContext->Parent = nullptr ;
1061
1060
1061
+ #pragma clang diagnostic push
1062
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
1062
1063
// Initialize the resumption funclet pointer (async return address) to
1063
1064
// the final funclet for completing the task.
1064
1065
@@ -1072,20 +1073,21 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
1072
1073
// The final funclet shouldn't release the task or the task function.
1073
1074
} else if (asyncLet) {
1074
1075
initialContext->ResumeParent =
1075
- std::bit_cast <TaskContinuationFunction *>(&completeTask);
1076
+ reinterpret_cast <TaskContinuationFunction*>(&completeTask);
1076
1077
1077
1078
// If we have a non-null closure context and the task function is not
1078
1079
// consumed by calling it, use a final funclet that releases both the
1079
1080
// task and the closure context.
1080
1081
} else if (closureContext && !taskCreateFlags.isTaskFunctionConsumed ()) {
1081
1082
initialContext->ResumeParent =
1082
- std::bit_cast <TaskContinuationFunction *>(&completeTaskWithClosure);
1083
+ reinterpret_cast <TaskContinuationFunction*>(&completeTaskWithClosure);
1083
1084
1084
1085
// Otherwise, just release the task.
1085
1086
} else {
1086
1087
initialContext->ResumeParent =
1087
- std::bit_cast <TaskContinuationFunction *>(&completeTaskAndRelease);
1088
+ reinterpret_cast <TaskContinuationFunction*>(&completeTaskAndRelease);
1088
1089
}
1090
+ #pragma clang diagnostic pop
1089
1091
1090
1092
// Initialize the task-local allocator and our other private runtime
1091
1093
// state for the task.
0 commit comments