gcc/libstdc++-v3/config
Jonathan Wakely c534e37fac
libstdc++: Populate std::time_get::get's %c format for C locale
We were using the empty string "" for D_T_FMT and ERA_D_T_FMT in the C
locale, instead of "%a %b %e %T %Y" as the C standard requires. Set it
correctly for each locale implementation that defines time_members.cc.

We can also explicitly set the _M_era_xxx pointers to the same values as
the corresponding _M_xxx ones, rather than setting them to point to
identical string literals. This doesn't rely on the compiler merging
string literals, and makes it more explicit that they're the same in the
C locale.

libstdc++-v3/ChangeLog:

	* config/locale/dragonfly/time_members.cc
	(__timepunct<char>::_M_initialize_timepunc)
	(__timepunct<wchar_t>::_M_initialize_timepunc): Set
	_M_date_time_format for C locale. Set %Ex formats to the same
	values as the %x formats.
	* config/locale/generic/time_members.cc: Likewise.
	* config/locale/gnu/time_members.cc: Likewise.
	* testsuite/22_locale/time_get/get/char/5.cc: New test.
	* testsuite/22_locale/time_get/get/wchar_t/5.cc: New test.
2024-10-02 11:36:17 +01:00
..
abi libstdc++: Handle encodings in localized chrono formatting [PR109162] 2024-07-31 17:07:10 +01:00
allocator Update copyright years. 2024-01-03 12:19:35 +01:00
cpu libstdc++: Fix @file for target-specific opt_random.h 2024-08-28 21:34:21 +01:00
io Update copyright years. 2024-01-03 12:19:35 +01:00
locale libstdc++: Populate std::time_get::get's %c format for C locale 2024-10-02 11:36:17 +01:00
os libstdc++-v3: Fix signed-overflow warning for newlib/ctype_base.h, PR116895 2024-10-01 02:14:10 +02:00