From edb2a4e7ef2c18f742a7048fd6b722435bfdbb7b Mon Sep 17 00:00:00 2001 From: aurianer Date: Tue, 21 Jan 2025 11:07:50 +0100 Subject: [PATCH] Remove non_receiver_6 and rename non_receiver_7 to non_receiver_6 One static_assert on non_receiver_6 was checking if a receiver with a set_error without noexcept is a receiver or not. non_receiver_6 without noexcept on set_error is recognized as a receiver when we add the SFINAE to the cpo in receiver.hpp. If we remove this SFINAE, the static_assert inside the CPO that the set_error impl should be noexcept is triggered (what we expect). Trying with stdexec (adding the PIKA_STDEXEC_RECEIVER_CONCEPT to the non_receiver_6, so that we test the noexceptness of set_error has the same behaviour as non stdexec code. It's recognized as a receiver even without the noexceptness. Since the behaviours are similar both with stdexec and without, I'm removing this specific test case for now. It could be interesting to figure out why the SFINAE discards the candidate, or to add a stronger condition to satisfy the is_receiver trait. --- .../execution_base/tests/unit/basic_receiver.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libs/pika/execution_base/tests/unit/basic_receiver.cpp b/libs/pika/execution_base/tests/unit/basic_receiver.cpp index ef05060b8..20391cf31 100644 --- a/libs/pika/execution_base/tests/unit/basic_receiver.cpp +++ b/libs/pika/execution_base/tests/unit/basic_receiver.cpp @@ -118,14 +118,7 @@ namespace mylib { struct non_receiver_6 { - friend void tag_invoke(ex::set_stopped_t, non_receiver_6&&) noexcept { done_called = true; } - - void set_error(std::exception_ptr) && { error_called = true; } - }; - - struct non_receiver_7 - { - friend void tag_invoke(ex::set_stopped_t, non_receiver_7&&) { done_called = true; } + friend void tag_invoke(ex::set_stopped_t, non_receiver_6&&) { done_called = true; } void set_error(std::exception_ptr) && { error_called = true; } }; @@ -215,8 +208,6 @@ int main() "mylib::non_receiver_5 should not be a receiver"); static_assert(!ex::is_receiver_v, "mylib::non_receiver_6 should not be a receiver"); - static_assert(!ex::is_receiver_v, - "mylib::non_receiver_7 should not be a receiver"); #if !defined(PIKA_NVHPC_VERSION) || !defined(PIKA_HAVE_STDEXEC) static_assert(!receiver_of_helper_v, @@ -231,8 +222,6 @@ int main() "mylib::non_receiver_5 should not be a receiver of int"); static_assert(!receiver_of_helper_v, "mylib::non_receiver_6 should not be a receiver of int"); - static_assert(!receiver_of_helper_v, - "mylib::non_receiver_7 should not be a receiver of int"); #endif {