libstdc++: Fix std::chrono::file_clock conversions for low-precision times
commitfba15da8fa518bfb8d3e061795bc3ca2dea01d27
authorJonathan Wakely <jwakely@redhat.com>
Sun, 21 Jan 2024 18:11:16 +0000 (21 18:11 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sun, 21 Jan 2024 22:15:06 +0000 (21 22:15 +0000)
tree065a4951ba9872678f8b218818b339c72d0757b0
parent86de9b66480b710202a2898cf513db105d8c432f
libstdc++: Fix std::chrono::file_clock conversions for low-precision times

THe std::chrono::file_clock conversions were not using common_type and
so failed to compile when converting anything that should have increased
precision after arithmetic with a std::chrono::seconds value.

libstdc++-v3/ChangeLog:

* include/bits/chrono.h (__file_clock::from_sys)
(__file_clock::to_sys, __file_clock::_S_from_sys)
(__file_clock::_S_to_sys): Use common_type for return type.
* testsuite/std/time/clock/file/members.cc: Check round trip
conversion for time with lower precision that seconds.
libstdc++-v3/include/bits/chrono.h
libstdc++-v3/testsuite/std/time/clock/file/members.cc