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.

3956. chrono::parse uses from_stream as a customization point

Section: 30.13 [time.parse] Status: Tentatively Ready Submitter: Jonathan Wakely Opened: 2023-07-15 Last modified: 2024-12-09

Priority: 3

View other active issues in [time.parse].

View all other issues in [time.parse].

View all issues with Tentatively Ready status.

Discussion:

30.13 [time.parse] says: "Each parse overload specified in this subclause calls from_stream unqualified, so as to enable argument dependent lookup (6.5.4 [basic.lookup.argdep])." That name should be added to 16.4.2.2 [contents] along with swap, make_error_code, and make_error_condition.

We should decide whether calls to from_stream should use normal lookup (i.e. unqualified lookup plus ADL) or just ADL, as was done for make_error_code and make_error_condition (see LWG 3629(i)).

[2023-10-30; Reflector poll]

Set priority to 3 after reflector poll.

[2024-12-02; Jonathan provides wording]

I suggest that from_stream should only be found via ADL, not unqualified lookup. This is consistent with what we did for make_error_code and make_error_condition, and more recently for submdspan_mapping. I see no reason to treat from_stream differently. This implies that implementations might need a poison poll in std::chrono so that unqualified lookup stops as soon as those are found.

[2024-12-09; Reflector poll]

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

Proposed resolution:

This wording is relative to N4993.

  1. Modify 16.4.2.2 [contents] as indicated:

    -3- Whenever an unqualified name other than swap, make_error_code, make_error_condition, from_stream, or submdspan_mapping is used in the specification of a declaration D in Clause 17 through Clause 33 or Annex D, its meaning is established as-if by performing unqualified name lookup (6.5.3 [basic.lookup.unqual]) in the context of D.

    [Note 1: Argument-dependent lookup is not performed. — end note]

    Similarly, the meaning of a qualified-id is established as-if by performing qualified name lookup (6.5.5 [basic.lookup.qual]) in the context of D.

    [Example 1: The reference to is_array_v in the specification of std::to_array (23.3.3.6 [array.creation]) refers to ::std::is_array_v. — end example]

    [Note 2: Operators in expressions (12.2.2.3 [over.match.oper]) are not so constrained; see 16.4.6.4 [global.functions]. — end note]

    The meaning of the unqualified name swap is established in an overload resolution context for swappable values (16.4.4.3 [swappable.requirements]). The meanings of the unqualified names make_error_code, make_error_condition, from_stream, and submdspan_mapping are established as-if by performing argument-dependent lookup (6.5.4 [basic.lookup.argdep]).