diff --git a/include/exec/at_coroutine_exit.hpp b/include/exec/at_coroutine_exit.hpp index 9a872f67f..6e38c85bd 100644 --- a/include/exec/at_coroutine_exit.hpp +++ b/include/exec/at_coroutine_exit.hpp @@ -25,6 +25,11 @@ #include #include +#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 diff --git a/include/exec/task.hpp b/include/exec/task.hpp index d800318ca..1b0cbda61 100644 --- a/include/exec/task.hpp +++ b/include/exec/task.hpp @@ -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") @@ -419,6 +422,7 @@ namespace experimental::execution __std::coroutine_handle<_Promise> __parent_; }; +#if !STDEXEC_APPLE_CLANG() template struct __reschedule_awaiter { @@ -491,6 +495,7 @@ namespace experimental::execution return {static_cast<_Scheduler&&>(__sched)}; } }; +#endif //////////////////////////////////////////////////////////////////////////////// // basic_task @@ -611,6 +616,7 @@ namespace experimental::execution } } +# if !STDEXEC_APPLE_CLANG() template requires __start_scheduler_provider<_Context> auto await_transform(__reschedule_coroutine_on_t::__wrapper<_Scheduler> __box) noexcept @@ -618,6 +624,7 @@ namespace experimental::execution { return __reschedule_awaiter<_Scheduler, __promise>{__box.__sched_}; } +# endif #endif template <__sender_adaptor_closure_for<__just_void<__scheduler_t>> _Closure> @@ -718,7 +725,9 @@ namespace experimental::execution template 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; diff --git a/test/exec/test_at_coroutine_exit.cpp b/test/exec/test_at_coroutine_exit.cpp index a566856bf..65ef942d5 100644 --- a/test/exec/test_at_coroutine_exit.cpp +++ b/test/exec/test_at_coroutine_exit.cpp @@ -17,7 +17,7 @@ #include -#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS() && !STDEXEC_APPLE_CLANG() # include # include # include diff --git a/test/exec/test_task.cpp b/test/exec/test_task.cpp index e64e662a5..9d2d6a137 100644 --- a/test/exec/test_task.cpp +++ b/test/exec/test_task.cpp @@ -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, @@ -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,