This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Tentatively Ready status.

4415. task::promise_type::uncaught_exception seems to be misnamed

Section: 33.13.6.5 [task.promise] Status: Tentatively Ready Submitter: Jiang An Opened: 2025-10-17 Last modified: 2025-10-23

Priority: Not Prioritized

View other active issues in [task.promise].

View all other issues in [task.promise].

View all issues with Tentatively Ready status.

Discussion:

According to 9.6.4 [dcl.fct.def.coroutine], a function of name unhandled_exception may be called by the language mechanisms. However, std::execution::task<T, Environment>::promise_type has an uncaught_exception function instead, which won't be implicitly called.

In P3552R3, unhandled_exception was discussed, but the wording specified uncaught_exception, which looks like a mistake. Moreover, the paper didn't talk about the status of uncaught_exception in the zombie name list ([tab:zombie.names.std]). Perhaps unhandled_exception is the correct function name.

[2025-10-23; Reflector poll.]

Set status to Tentatively Ready after five votes in favour during reflector poll.

Proposed resolution:

This wording is relative to N5014.

  1. Modify 33.13.6.5 [task.promise] as indicated:

    namespace std::execution {
      template<class T, class Environment>
      class task<T, Environment>::promise_type {
      public:
        […]
        void uncaughtunhandled_exception();
        coroutine_handle<> unhandled_stopped();    
        […]
      };
    }
    
    […]
    void uncaughtunhandled_exception();
    

    -12- Effects: If the signature set_error_t(exception_ptr) is not an element of error_types, calls terminate() (14.6.2 [except.terminate]). Otherwise, stores current_exception() into errors.