]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix formatter for low-resolution chrono::zoned_time (LWG 4124)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 29 Jul 2024 11:52:40 +0000 (12:52 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 30 Jul 2024 20:14:29 +0000 (21:14 +0100)
commit4883c9571f5fb8fc7e873bb8a31aa164c5cfd0e0
treeb0c4f26cc617fdefde143e4588d5abde82533c12
parent8f05ada7dfb9a40d4333a2aa9ccb5ddcdf8e2b06
libstdc++: Fix formatter for low-resolution chrono::zoned_time (LWG 4124)

This implements the proposed resolution of LWG 4124, so that
low-resolution chrono::zoned_time objects can be formatted. The
formatter for zoned_time<D, P> needs to account for get_local_time
returning local_time<common_type_t<D, seconds>> not local_time<D>.

libstdc++-v3/ChangeLog:

* include/bits/chrono_io.h (__local_time_fmt_for): New alias
template.
(formatter<zoned_time<D, P>>): Use __local_time_fmt_for.
* testsuite/std/time/zoned_time/io.cc: Check zoned_time<minutes>
can be formatted.
libstdc++-v3/include/bits/chrono_io.h
libstdc++-v3/testsuite/std/time/zoned_time/io.cc