Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make set_error use member function instead of tag_invoke #1369

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

aurianer
Copy link
Contributor

@aurianer aurianer commented Dec 10, 2024

Part of #1204

I guess the main change worth to mention here is the removal of non_receiver_6 (and renaming of non_receiver_7 to non_receiver_6).
decription of the corresponding commit:
One static_assert on non_receiver_6 was checking if a receiver with a set_error without noexcept is a receiver or not. The standard says that it should not. non_receiver_6 without noexcept on set_error is recognized as a receiver. If we remove the SFINAE to the set_error cpo in receiver.hpp, 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 it doesn't get discarded at the concept but we can actually 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.

Copy link

codacy-production bot commented Dec 10, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.10% (target: -1.00%) 78.72% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1ab788b) 18223 13739 75.39%
Head commit (edb2a4e) 18244 (+21) 13737 (-2) 75.30% (-0.10%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1369) 47 37 78.72%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@aurianer aurianer force-pushed the set_error_member_function branch from 2dfdcbf to 2007442 Compare December 10, 2024 15:40
@aurianer aurianer changed the title Make set_error use member function instead of tag_invoke Make set_error use member function instead of tag_invoke Dec 16, 2024
@aurianer aurianer changed the title Make set_error use member function instead of tag_invoke Make set_error use member function instead of tag_invoke Dec 16, 2024
@aurianer aurianer force-pushed the set_error_member_function branch 3 times, most recently from eef0497 to 0058ce4 Compare January 21, 2025 10:22
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.
@aurianer aurianer force-pushed the set_error_member_function branch from 0058ce4 to edb2a4e Compare January 21, 2025 10:33
@aurianer aurianer marked this pull request as ready for review January 21, 2025 10:35
@@ -447,7 +449,7 @@ function(pika_check_for_cxx23_static_call_operator)
pika_add_config_test(
PIKA_WITH_CXX23_STATIC_CALL_OPERATOR
SOURCE cmake/tests/cxx23_static_call_operator.cpp
FILE ${ARGN}
FILE ${ARGN} CXXFLAGS -pedantic-errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what the failure mode is if this flag isn't supported? Does the test fail or does configuration fail? I'm thinking e.g. about nvc++ which may not support the flag, but if it does it's perhaps not such a big concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants