Skip to content

Commit

Permalink
Remove non_receiver_6 and rename non_receiver_7 to non_receiver_6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aurianer committed Jan 21, 2025
1 parent eb93b52 commit edb2a4e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions libs/pika/execution_base/tests/unit/basic_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
};
Expand Down Expand Up @@ -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>,
"mylib::non_receiver_6 should not be a receiver");
static_assert(!ex::is_receiver_v<mylib::non_receiver_7>,
"mylib::non_receiver_7 should not be a receiver");

#if !defined(PIKA_NVHPC_VERSION) || !defined(PIKA_HAVE_STDEXEC)
static_assert(!receiver_of_helper_v<mylib::non_receiver_1, int>,
Expand All @@ -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, int>,
"mylib::non_receiver_6 should not be a receiver of int");
static_assert(!receiver_of_helper_v<mylib::non_receiver_7, int>,
"mylib::non_receiver_7 should not be a receiver of int");
#endif

{
Expand Down

0 comments on commit edb2a4e

Please sign in to comment.