https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120810
Bug ID: 120810
Summary: [DR 461] std::time_get::do_get_date should consider
date_order()
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Depends on: 9635
Blocks: 86976
Target Milestone: ---
https://cplusplus.github.io/LWG/issue461
We use the locale's D_FMT format (which is what strftime %x uses too). I think
that works OK in general, and actually seems preferable to DR 461.
DR 461 says we should consider the result of date_order() when deciding how to
parse a date, but that seems to be a poor substitute for knowing the locale's
D_FMT format. DR 461 says "figure out the locale's preferred date format from
one of these four distinct options" but that assumes that the locale _uses_ one
of those options, and that you can find a way to get it from do_date_order()
(which we can't! see Bug 9635).
We could add code to std::time_get::do_get_date() which calls do_date_order()
and if it's not no_order then use the format it specifies. That would do the
right thing for facets derived from std::time_get which override
do_date_order(). If it returns no_order, then fallback to using D_FMT as we do
now.
N.B. testsuite/22_locale/time_get/get_time/char/6.cc (and the wchar_t
equivalent) mention 461 and have some commented out checks that depend on it.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9635
[Bug 9635] time_get<>::date_order unimplemented
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86976
[Bug 86976] [meta-bug] Issues with std::time_get, std::time_put etc.