Title
Can the overload of std::num_get::do_get for bool call the overload for long?
Status
nad
Section
[facet.num.get.virtuals]
Submitter
Jiang An

Created on 2024-09-29.00:00:00 last changed 1 month ago

Messages

Date: 2025-02-15.00:00:00

[ 2025-02-07; Reflector poll: NAD ]

I think this is just a libc++ bug. The wording says it "proceeds as it would for `long`", which is not the same as actually making a virtual call to `do_get` for `long`. It can either duplicate the code from `do_get` for `long`, or make a non-virtual (i.e. qualified) call to `num_get::do_get`.

Date: 2024-09-29.00:00:00

[facet.num.get.virtuals]/6 currently says:

Effects: If (str.flags()&ios_base::boolalpha) == 0 then input proceeds as it would for a long except that if a value is being stored into val, […]

It is unclear whether an implementation is allowed to call the overload for long in this case. Currently, libc++'s version calls that overload, while libstdc++ and MSVC STL's don't (example).

As the divergence implementation strategies is observable, perhaps we should clarify on this.

History
Date User Action Args
2025-02-07 16:46:48adminsetmessages: + msg14582
2025-02-07 16:46:48adminsetstatus: new -> nad
2024-09-29 00:00:00admincreate