Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/exec/at_coroutine_exit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#include <exception>
#include <tuple>

#if STDEXEC_APPLE_CLANG()
# error \
"at_coroutine_exit is not supported on Apple Clang due to a compiler bug that causes use-after-scope."
#endif

namespace experimental::execution
{
namespace __at_coro_exit
Expand Down
11 changes: 10 additions & 1 deletion include/exec/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
#include "../stdexec/functional.hpp"

#include "any_sender_of.hpp"
#include "at_coroutine_exit.hpp"
#include "completion_behavior.hpp"
#include "scope.hpp"

#if !STDEXEC_APPLE_CLANG()
# include "at_coroutine_exit.hpp"
#endif

STDEXEC_PRAGMA_PUSH()
STDEXEC_PRAGMA_IGNORE_GNU("-Wundefined-inline")

Expand Down Expand Up @@ -419,6 +422,7 @@ namespace experimental::execution
__std::coroutine_handle<_Promise> __parent_;
};

#if !STDEXEC_APPLE_CLANG()
template <class _Scheduler, class _Promise>
struct __reschedule_awaiter
{
Expand Down Expand Up @@ -491,6 +495,7 @@ namespace experimental::execution
return {static_cast<_Scheduler&&>(__sched)};
}
};
#endif

////////////////////////////////////////////////////////////////////////////////
// basic_task
Expand Down Expand Up @@ -611,13 +616,15 @@ namespace experimental::execution
}
}

# if !STDEXEC_APPLE_CLANG()
template <class _Scheduler>
requires __start_scheduler_provider<_Context>
auto await_transform(__reschedule_coroutine_on_t::__wrapper<_Scheduler> __box) noexcept
-> decltype(auto)
{
return __reschedule_awaiter<_Scheduler, __promise>{__box.__sched_};
}
# endif
#endif

template <__sender_adaptor_closure_for<__just_void<__scheduler_t>> _Closure>
Expand Down Expand Up @@ -718,7 +725,9 @@ namespace experimental::execution
template <class _Ty>
using task = basic_task<_Ty, default_task_context<_Ty>>;

#if !STDEXEC_APPLE_CLANG()
inline constexpr __task::__reschedule_coroutine_on_t reschedule_coroutine_on{};
#endif
} // namespace experimental::execution

namespace exec = experimental::execution;
Expand Down
2 changes: 1 addition & 1 deletion test/exec/test_at_coroutine_exit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <stdexec/coroutine.hpp>

#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS()
#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS() && !STDEXEC_APPLE_CLANG()
# include <catch2/catch_all.hpp>
# include <exec/at_coroutine_exit.hpp>
# include <exec/on_coro_disposition.hpp>
Expand Down
2 changes: 2 additions & 0 deletions test/exec/test_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace
return thread_id;
}

# if !STDEXEC_APPLE_CLANG()
auto test_stickiness_for_two_single_thread_contexts_nested(ex::scheduler auto scheduler1,
ex::scheduler auto,
auto id1,
Expand Down Expand Up @@ -210,6 +211,7 @@ namespace
auto t = test_stickiness_for_two_single_thread_contexts(scheduler1, scheduler2, id1, id2);
ex::sync_wait(std::move(t));
}
# endif

auto test_stick_on_main_nested(ex::scheduler auto sched1,
ex::scheduler auto,
Expand Down
Loading