exec::sequence: Exception Correctness#1878
Open
RobertLeahy wants to merge 1 commit intoNVIDIA:mainfrom
Open
Conversation
Corrected two exception-related problems with exec::sequence: - Previously exec::sequence senders unconditionally reported that they could throw when connected - Previously exec::sequence senders unconditionally reported that they could send set_error_t(std::exception_ptr), updated so this is now reported only if it's possible (i.e. if a child sender has that completion, or if any child sender other than the first possibly throws when connected)
f31b43f to
6ac7829
Compare
ericniebler
requested changes
Feb 21, 2026
| STDEXEC_ATTRIBUTE(host, device) | ||
| constexpr explicit _opstate(Rcvr&& rcvr, CvSndrs&& sndrs) | ||
| noexcept(::STDEXEC::__nothrow_connectable< | ||
| decltype(::STDEXEC::__get<0>(::STDEXEC::__declval<CvSndrs>())), |
Collaborator
There was a problem hiding this comment.
Suggested change
| decltype(::STDEXEC::__get<0>(::STDEXEC::__declval<CvSndrs>())), | |
| ::STDEXEC::__tuple_element_t<0, CvSndrs>, |
Comment on lines
+182
to
+185
| constexpr auto nothrow = noexcept( | ||
| self->_ops.template __emplace_from<__nth + 1>(STDEXEC::connect, | ||
| std::move(sndr), | ||
| _rcvr_t < Remaining == 1 > {self})); |
Collaborator
There was a problem hiding this comment.
i think this can just be:
constexpr bool nothrow =
STDEXEC::__nothrow_connectable<STDEXEC::__m_at_c<__nth + 1, Senders...>,
_rcvr_t<Remaining == 1>>;
Comment on lines
+262
to
+265
| std::conditional_t< | ||
| _add_exception_ptr<First, AddExceptionPtr, Head>, | ||
| STDEXEC::completion_signatures<STDEXEC::set_error_t(std::exception_ptr)>, | ||
| STDEXEC::completion_signatures<>>, |
Collaborator
There was a problem hiding this comment.
Suggested change
| std::conditional_t< | |
| _add_exception_ptr<First, AddExceptionPtr, Head>, | |
| STDEXEC::completion_signatures<STDEXEC::set_error_t(std::exception_ptr)>, | |
| STDEXEC::completion_signatures<>>, | |
| STDEXEC::__eptr_completion_unless<_add_exception_ptr<First, AddExceptionPtr, Head>>, |
| if constexpr (STDEXEC::__decay_copyable<Self>) | ||
| if constexpr (sizeof...(Env) == 0) | ||
| { | ||
| return STDEXEC::__dependent_sender<Self>(); |
Collaborator
There was a problem hiding this comment.
a better way to do this is to require an Env parameter:
template <class Self, class Env>
STDEXEC_ATTRIBUTE(host, device)
static consteval auto get_completion_signatures()
{then you don't need the if constexpr (sizeof...(Env) == 0) branch.
Collaborator
|
/ok to test 6ac7829 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrected two exception-related problems with exec::sequence: