aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-09-24 23:20:56 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-10-02 11:36:17 +0100
commitc534e37faccf481afa9bc28f0605ca0ec3846c89 (patch)
treee5153070a03c390f8eef2764e21d9b107fd644d9 /gcc/tree-if-conv.cc
parent5cf26f2569bf007a2c9c058e43ddfe9a5f67da42 (diff)
downloadgcc-c534e37faccf481afa9bc28f0605ca0ec3846c89.zip
gcc-c534e37faccf481afa9bc28f0605ca0ec3846c89.tar.gz
gcc-c534e37faccf481afa9bc28f0605ca0ec3846c89.tar.bz2
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.
Diffstat (limited to 'gcc/tree-if-conv.cc')
0 files changed, 0 insertions, 0 deletions