Skip to content

Make exec::without conditionally noexcept - #2213

Merged
ericniebler merged 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/without-noexcept
Aug 18, 2026
Merged

Make exec::without conditionally noexcept#2213
ericniebler merged 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/without-noexcept

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What changed

  • Make exec::without derive its exception specification from the selected return object construction.
  • Keep lvalue environments nothrow when without only stores a reference.
  • Add regressions for throwing rvalue environment moves in both queryable and missing-query paths.

Why

exec::without was unconditionally noexcept, even though it can move an rvalue environment into its return object. A throwing move could terminate instead of propagating the exception.

Testing

  • build/test/exec/test.exec [env]
  • ctest --test-dir build --output-on-failure -j 8

All 953 configured tests passed.

@copy-pr-bot

copy-pr-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Comment thread include/exec/env.hpp Outdated
constexpr auto operator()(_Env&& __env, _Query) const noexcept
constexpr auto operator()(_Env&& __env, _Query) const noexcept(
STDEXEC::__nothrow_constructible_from<
STDEXEC::__if_c<STDEXEC::__queryable_with<_Env, _Query>, __without<_Env, _Query>, _Env>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this isn't quite right because the function currently always returns by value, and _Env could be a reference type. Arguably, the function should either be returning a __without<_Env, _Query> or an _Env. it would probably be easiest to split this into two overloads instead of using an if constexpr.

Comment thread include/exec/env.hpp Outdated
Comment thread include/exec/env.hpp Outdated
Co-authored-by: Eric Niebler <eniebler@boost.org>
@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 1897253

@ericniebler
ericniebler merged commit fb944c3 into NVIDIA:main Aug 18, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants