diff --git a/libs/core/execution/include/hpx/execution/algorithms/let_stopped.hpp b/libs/core/execution/include/hpx/execution/algorithms/let_stopped.hpp index c52da87b60c6..7744096a52cb 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/let_stopped.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/let_stopped.hpp @@ -111,12 +111,12 @@ namespace hpx::execution::experimental { // clang-format on }; + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, let_stopped_sender const&, Env) noexcept -> generate_completion_signatures; - // clang-format off template && diff --git a/libs/core/execution/include/hpx/execution/algorithms/let_value.hpp b/libs/core/execution/include/hpx/execution/algorithms/let_value.hpp index fd478d2341dc..cdcd9e55af42 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/let_value.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/let_value.hpp @@ -130,12 +130,12 @@ namespace hpx::execution::experimental { // clang-format on }; + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, let_value_sender const&, Env) noexcept -> generate_completion_signatures; - // clang-format off template && diff --git a/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp b/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp index 9047f5005333..6f135947e269 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/run_loop.hpp @@ -243,11 +243,13 @@ namespace hpx::execution::experimental { std::exception_ptr), hpx::execution::experimental::set_stopped_t()>; + // clang-format off template friend auto tag_invoke( hpx::execution::experimental::get_completion_signatures_t, run_loop_sender const&, Env) noexcept -> completion_signatures; + // clang-format on run_loop& loop; }; diff --git a/libs/core/execution/include/hpx/execution/algorithms/schedule_from.hpp b/libs/core/execution/include/hpx/execution/algorithms/schedule_from.hpp index aa442649274e..e6f38bcd18fd 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/schedule_from.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/schedule_from.hpp @@ -73,12 +73,12 @@ namespace hpx::execution::experimental { static constexpr bool sends_stopped = false; }; + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, schedule_from_sender const&, Env) -> generate_completion_signatures; - // clang-format off template friend auto tag_invoke(get_completion_signatures_t, split_sender const&, Env) -> generate_completion_signatures; - // clang-format off template && diff --git a/libs/core/execution/include/hpx/execution/algorithms/when_all.hpp b/libs/core/execution/include/hpx/execution/algorithms/when_all.hpp index bf57642152e7..3e26f9b720d6 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/when_all.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/when_all.hpp @@ -245,10 +245,12 @@ namespace hpx::execution::experimental { static constexpr bool sends_stopped = true; }; + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, when_all_sender const&, Env) noexcept -> generate_completion_signatures; + // clang-format on static constexpr std::size_t num_predecessors = sizeof...(Senders); static_assert(num_predecessors > 0, diff --git a/libs/core/execution/include/hpx/execution/algorithms/when_all_vector.hpp b/libs/core/execution/include/hpx/execution/algorithms/when_all_vector.hpp index b6155b9d366a..34bbdfeeb842 100644 --- a/libs/core/execution/include/hpx/execution/algorithms/when_all_vector.hpp +++ b/libs/core/execution/include/hpx/execution/algorithms/when_all_vector.hpp @@ -161,11 +161,13 @@ namespace hpx::when_all_vector_detail { static constexpr bool sends_stopped = true; }; + // clang-format off template friend auto tag_invoke( hpx::execution::experimental::get_completion_signatures_t, when_all_vector_sender_type const&, Env) noexcept -> generate_completion_signatures; + // clang-format on #endif template @@ -249,6 +251,7 @@ namespace hpx::when_all_vector_detail { r.op_state.finish(); } + // clang-format off friend auto tag_invoke(hpx::execution::experimental::get_env_t, when_all_vector_receiver const& r) #ifdef HPX_HAVE_STDEXEC @@ -283,6 +286,7 @@ namespace hpx::when_all_vector_detail { r.op_state.receiver)); } #endif + // clang-format on }; std::size_t const num_predecessors; diff --git a/libs/core/execution/include/hpx/execution/queries/read.hpp b/libs/core/execution/include/hpx/execution/queries/read.hpp index 09256cdbee07..8959fb79ec10 100644 --- a/libs/core/execution/include/hpx/execution/queries/read.hpp +++ b/libs/core/execution/include/hpx/execution/queries/read.hpp @@ -89,12 +89,12 @@ namespace hpx::execution::experimental { HPX_FORWARD(Receiver, receiver)}; } + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, read_sender, no_env) -> dependent_completion_signatures; - // clang-format off template friend auto tag_invoke(get_completion_signatures_t, read_sender, Env) { diff --git a/libs/core/execution/tests/unit/algorithm_execute.cpp b/libs/core/execution/tests/unit/algorithm_execute.cpp index 23954f73476a..662e1f2fbb4d 100644 --- a/libs/core/execution/tests/unit/algorithm_execute.cpp +++ b/libs/core/execution/tests/unit/algorithm_execute.cpp @@ -36,6 +36,7 @@ struct execute_example_sender } #endif + // clang-format off template friend auto tag_invoke(ex::get_completion_signatures_t, execute_example_sender const&, @@ -45,6 +46,7 @@ struct execute_example_sender { friend void tag_invoke(ex::start_t, operation_state&) noexcept {}; }; + // clang-format on template friend operation_state tag_invoke( @@ -113,17 +115,23 @@ void tag_invoke(ex::execute_t, scheduler_2, F&&) struct f_struct_1 { + // clang-format off void operator()() {}; + // clang-format on }; struct f_struct_2 { + // clang-format off void operator()(int) {}; + // clang-format on }; struct f_struct_3 { + // clang-format off void operator()(int = 42) {}; + // clang-format on }; void f_fun_1() {} diff --git a/libs/core/execution_base/include/hpx/execution_base/any_sender.hpp b/libs/core/execution_base/include/hpx/execution_base/any_sender.hpp index 40100c9b25df..11ee20e232a9 100644 --- a/libs/core/execution_base/include/hpx/execution_base/any_sender.hpp +++ b/libs/core/execution_base/include/hpx/execution_base/any_sender.hpp @@ -784,15 +784,18 @@ namespace hpx::execution::experimental { unique_any_sender& operator=(unique_any_sender const&) = delete; #ifdef HPX_HAVE_STDEXEC + // TODO: Remove this using completion_signatures = hpx::execution::experimental::completion_signatures< set_value_t(Ts...), set_error_t(std::exception_ptr)>; #else + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, unique_any_sender const&, Env) noexcept -> completion_signatures; + // clang-format on #endif template @@ -868,14 +871,17 @@ namespace hpx::execution::experimental { any_sender& operator=(any_sender const&) = default; #ifdef HPX_HAVE_STDEXEC + // TODO: Remove this using completion_signatures = hpx::execution::experimental::completion_signatures< set_value_t(Ts...), set_error_t(std::exception_ptr)>; #else + // clang-format off template friend auto tag_invoke(get_completion_signatures_t, any_sender const&, Env) noexcept -> completion_signatures; + // clang-format on #endif template diff --git a/libs/core/execution_base/include/hpx/execution_base/completion_scheduler.hpp b/libs/core/execution_base/include/hpx/execution_base/completion_scheduler.hpp index 054a8dce8670..80ca7308260a 100644 --- a/libs/core/execution_base/include/hpx/execution_base/completion_scheduler.hpp +++ b/libs/core/execution_base/include/hpx/execution_base/completion_scheduler.hpp @@ -15,6 +15,7 @@ #include namespace hpx::execution::experimental { namespace detail { + // clang-format off template concept has_completion_scheduler_v = requires(Sender&& s) { { @@ -32,6 +33,7 @@ namespace hpx::execution::experimental { namespace detail { hpx::execution::experimental::get_env(snd)), std::forward(snd), std::forward(ts)...); }; + // clang-format on }} // namespace hpx::execution::experimental::detail #else diff --git a/libs/core/execution_base/include/hpx/execution_base/completion_signatures.hpp b/libs/core/execution_base/include/hpx/execution_base/completion_signatures.hpp index 07212f345f10..7e5c9ccc4c29 100644 --- a/libs/core/execution_base/include/hpx/execution_base/completion_signatures.hpp +++ b/libs/core/execution_base/include/hpx/execution_base/completion_signatures.hpp @@ -1246,9 +1246,11 @@ namespace hpx::execution::experimental { return tag_invoke(as_awaitable, HPX_FORWARD(Ty, value), *this); } + // clang-format off template friend auto tag_invoke( get_env_t, env_promise const&) noexcept -> T const&; + // clang-format on }; struct with_awaitable_senders_base @@ -1468,11 +1470,13 @@ namespace hpx::execution::experimental { } // Pass through the get_env receiver query + // clang-format off friend auto tag_invoke( get_env_t, type const& self) -> env_of_t { return get_env(self.rcvr); } + // clang-format on Receiver& rcvr; }; @@ -1640,7 +1644,7 @@ namespace hpx::execution::experimental { connect_result_t op_state_; }; }; - } // namespace detail + } // namespace detail #endif // HPX_HAVE_CXX20_COROUTINES /// End definitions from coroutine_utils and sender diff --git a/libs/core/execution_base/tests/include/algorithm_test_utils.hpp b/libs/core/execution_base/tests/include/algorithm_test_utils.hpp index 7e9ce5b39a5f..55f8c39ee168 100644 --- a/libs/core/execution_base/tests/include/algorithm_test_utils.hpp +++ b/libs/core/execution_base/tests/include/algorithm_test_utils.hpp @@ -258,6 +258,7 @@ struct callback_receiver HPX_TEST(false); }; + // clang-format off template friend auto tag_invoke(hpx::execution::experimental::set_value_t, callback_receiver&& r, @@ -267,6 +268,7 @@ struct callback_receiver HPX_INVOKE(r.f, std::forward(ts)...); r.set_value_called = true; } + // clang-format on }; template diff --git a/libs/core/execution_base/tests/include/coroutine_task.hpp b/libs/core/execution_base/tests/include/coroutine_task.hpp index 9b8f38c0605b..a212dd64d6ee 100644 --- a/libs/core/execution_base/tests/include/coroutine_task.hpp +++ b/libs/core/execution_base/tests/include/coroutine_task.hpp @@ -51,6 +51,8 @@ inline constexpr bool indirect_stop_token_provider = template >, typename = std::enable_if_t && std::is_nothrow_invocable_v>> + +// clang-format off struct scope_guard { Fn fn_; @@ -63,6 +65,7 @@ struct scope_guard ((Fn&&) fn_)(); } }; +// clang-format on struct forward_stop_request { @@ -405,7 +408,7 @@ class basic_task } // Make this task generally awaitable: - friend task_awaitable<> operator co_await(basic_task && self) noexcept + friend task_awaitable<> operator co_await(basic_task&& self) noexcept { static_assert(well_formed); return task_awaitable<>{std::exchange(self.coro_, {})}; diff --git a/libs/core/execution_base/tests/unit/any_sender.cpp b/libs/core/execution_base/tests/unit/any_sender.cpp index 7147eda5a410..93439f8f876c 100644 --- a/libs/core/execution_base/tests/unit/any_sender.cpp +++ b/libs/core/execution_base/tests/unit/any_sender.cpp @@ -55,11 +55,13 @@ struct non_copyable_sender hpx::tuple...> ts; + // clang-format off template friend auto tag_invoke(ex::get_completion_signatures_t, non_copyable_sender const&, Env) noexcept -> ex::completion_signatures; + // clang-format on non_copyable_sender() = default; template friend auto tag_invoke(ex::get_completion_signatures_t, example_sender const&, Env) noexcept -> ex::completion_signatures; + // clang-format on example_sender() = default; template auto signature_values( Values...) -> ex::completion_signatures @@ -64,6 +65,7 @@ auto signature_all( { return {}; } +// clang-format on #ifdef HPX_HAVE_STDEXEC template diff --git a/libs/core/execution_base/tests/unit/get_env.cpp b/libs/core/execution_base/tests/unit/get_env.cpp index a3d1016009d6..cf0ad28b6027 100644 --- a/libs/core/execution_base/tests/unit/get_env.cpp +++ b/libs/core/execution_base/tests/unit/get_env.cpp @@ -40,6 +40,7 @@ namespace mylib { #ifdef HPX_HAVE_STDEXEC inline constexpr struct receiver_env_t final : ex::forwarding_query_t { + // clang-format off template requires ex::stdexec_non_standard_tag_invoke::tag_invocable< receiver_env_t, Env> @@ -47,6 +48,7 @@ namespace mylib { { return ex::stdexec_non_standard_tag_invoke::tag_invoke(*this, e); } + // clang-format on } receiver_env{}; #else inline constexpr struct receiver_env_t final @@ -106,6 +108,7 @@ namespace mylib { #ifdef HPX_HAVE_STDEXEC inline constexpr struct receiver_env1_t final : ex::forwarding_query_t { + // clang-format off template requires ex::stdexec_non_standard_tag_invoke::tag_invocable< receiver_env1_t, Env> @@ -113,6 +116,7 @@ namespace mylib { { return ex::stdexec_non_standard_tag_invoke::tag_invoke(*this, e); } + // clang-format on } receiver_env1{}; #else inline constexpr struct receiver_env1_t final diff --git a/libs/core/executors/include/hpx/executors/thread_pool_scheduler_bulk.hpp b/libs/core/executors/include/hpx/executors/thread_pool_scheduler_bulk.hpp index ac6927fcb3d8..b24e7cb51d20 100644 --- a/libs/core/executors/include/hpx/executors/thread_pool_scheduler_bulk.hpp +++ b/libs/core/executors/include/hpx/executors/thread_pool_scheduler_bulk.hpp @@ -733,13 +733,13 @@ namespace hpx::execution::experimental::detail { sends_stopped_of_v; }; + // clang-format off template friend auto tag_invoke( hpx::execution::experimental::get_completion_signatures_t, thread_pool_bulk_sender const&, Env) -> generate_completion_signatures; - // clang-format off template , ex::thread_pool_scheduler>, "the completion scheduler should be a thread_pool_scheduler"); - } + // clang-format off + } // Clang format bug: thinks this '}' is the end of a namespace. + // clang-format on { auto sender = diff --git a/libs/core/type_support/include/hpx/type_support/meta.hpp b/libs/core/type_support/include/hpx/type_support/meta.hpp index 8b91ac6b920e..9a40eaecf75e 100644 --- a/libs/core/type_support/include/hpx/type_support/meta.hpp +++ b/libs/core/type_support/include/hpx/type_support/meta.hpp @@ -507,13 +507,17 @@ namespace hpx::meta { using get_id_t = hpx::type_identity_t< hpx::meta::invoke>>, T>>; + // clang-format off template inline constexpr bool is_constructible_from_v = std::is_destructible_v && std::is_constructible_v; + // Clang format bug: thinks ^^this is a double reference template inline constexpr bool is_nothrow_constructible_from_v = is_constructible_from_v && + // Clang format bug: thinks this^^ is a double reference std::is_nothrow_constructible_v; + // clang-format on } // namespace hpx::meta diff --git a/libs/core/type_support/include/hpx/type_support/pack.hpp b/libs/core/type_support/include/hpx/type_support/pack.hpp index 68021fe0067d..06693e9d2e39 100644 --- a/libs/core/type_support/include/hpx/type_support/pack.hpp +++ b/libs/core/type_support/include/hpx/type_support/pack.hpp @@ -105,9 +105,11 @@ namespace hpx::util { template static constexpr std::false_type all_of(...); + // clang-format off template static constexpr auto all_of( int) -> always_true::value>...>; + // clang-format on } // namespace detail template @@ -128,10 +130,11 @@ namespace hpx::util { template static constexpr std::true_type any_of(...); - + // clang-format off template static constexpr auto any_of( int) -> always_false::value>...>; + // clang-format on } // namespace detail template