4529. task::promise_type::await_transform declaration and definition mismatch

Section: 33.13.6.5 [task.promise] Status: New Submitter: Dietmar Kühl Opened: 2026-02-21 Last modified: 2026-02-22

Priority: Not Prioritized

View other active issues in [task.promise].

View all other issues in [task.promise].

View all issues with New status.

Discussion:

The declarations of await_transform mismatch between the synopsis in 33.13.6.5 [task.promise] and the definition in 33.13.6.5 [task.promise] paragraph 9:

    template<class A>
      auto await_transform(A&& a);
    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch);
vs.
    template<sender Sender>
      auto await_transform(Sender&& sndr) noexcept;
    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch) noexcept;

The declaration should be fixed to match the definition.

Proposed resolution:

This wording is relative to N5032.

  1. Change the declarations of await_transform in the synopsis of promise_type in 33.13.6.5 [task.promise] to match the definition in 33.13.6.5 [task.promise] p9 except for omitting the noexcept specifier:

    namespace std::execution {
      template<class T, class Environment>
      class task<T, Environment>::promise_type {
      public:
        ... 
        template<class E>
          unspecified yield_value(with_error<E> error);
    
        template<class Asender Sender>
          auto await_transform(A&& aSender&& sndr);
        template<class Sch>
          auto await_transform(change_coroutine_scheduler<Sch> sch);
    
        unspecified get_env() const noexcept;
        ...
      };
    }
    
  2. Remove the noexcept specifier from the declarations of await_transform in the definition of promise_type in 33.13.6.5 [task.promise] p9:

    template<sender Sender>
      auto await_transform(Sender&& sndr) noexcept;
    

    -9- Returns: If same_as<inline_scheduler, scheduler_type> is true returns as_awaitable(std::forward<Sender>(sndr), *this); otherwise returns as_awaitable(affine_on(std::forward<Sender>(sndr), SCHED(*this)), *this).

    template<class Sch>
      auto await_transform(change_coroutine_scheduler<Sch> sch) noexcept;
    
    -10- Effects: Equivalent to:
         return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this);