https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114244
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> Yup, the seconds part "00.002" is parsed using std::numpunct (in order to
Oops, std::num_get obviously.
> handle the locale's decimal point) and then converted to milliseconds using
> duration_cast:
>
> auto& __ng = use_facet<num_get<_CharT>>(__loc);
> long double __val;
> ios_base::iostate __err2{};
> __ng.get(__buf, {}, __buf, __err2, __val);
> if (__is_failed(__err2)) [[unlikely]]
> __err |= __err2;
> else
> {
> duration<long double> __fs(__val);
> __s = duration_cast<_Duration>(__fs);
> }
As an unrelated optimization, when the locale is "C" we could use
std::from_chars or std::stod instead of std::num_get.