https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99556
Bug ID: 99556
Summary: time_get<wchar_t>::date_order() returns no_order on
en_US - it should return mdy
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: lewis at sophists dot com
Target Milestone: ---
Created attachment 50367
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50367&action=edit
locale_time_get_date_order_no_order_Buggy.cpp
According to
https://en.cppreference.com/w/cpp/locale/time_get/date_order
the 'date_order' field for the locale en_US should be MDY;
libstdc++ appears to understand this emprirically from how it parses dates.
However, the value returned by time_get<wchar_t>::date_order() is 'no_order'
instead of 'mdy'.
This behavior APPEARS faulty given the above documentation.
I would not this behavior is also DIFFERENT than libc++ (clangs library) and
differnt from visual studios implmenetation which all return the (apparently)
correct mdy value.
Compile with
g++ locale_time_get_date_order_no_order_Buggy.cpp
will happen with any compiler version, but I tested on the latest ubuntu with
g++ (Ubuntu 10.2.0-13ubuntu1) 10.2.0
Reproducing file is attached.
note - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9635 appears to be a
similar report, but is almost 20 years old.