4526. std::monostate could be a valid error for task

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 current specification of the error-variant in 33.13.6.5 [task.promise] p2 uses std::monostate as a placeholder for the absence of an error: variant<monostate, remove_cvref_t<E>...>. However, std::monostate can be an actual error type. It should be replaced by an implementation-defined, default constructible type.

Proposed resolution:

This wording is relative to N5032.

  1. In 33.13.6.5 [task.promise] p2 replace monostate with an implementation-defined, default constructible type:

    -2- error-variant is a variant<monostateempty, remove_cvref_t<E>...>, with duplicate types removed, where empty is an implementation-defined, default constructible type and E... are the parameter types of the template arguments of the specialization of execution::completion_signatures denoted by error_types.