diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-06-26 20:22:54 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-06-27 09:39:41 +0100 |
commit | dafa750c8a6f0a088677871bfaad054881737ab1 (patch) | |
tree | 4e27b9cf146ddf3890b1a2b09d2589d743a9933f /gcc/gimple-range-cache.h | |
parent | 8fd84bc009b3073666a24047c78a04c19eeab752 (diff) | |
download | gcc-dafa750c8a6f0a088677871bfaad054881737ab1.zip gcc-dafa750c8a6f0a088677871bfaad054881737ab1.tar.gz gcc-dafa750c8a6f0a088677871bfaad054881737ab1.tar.bz2 |
libstdc++: Fix std::format for chrono::duration with unsigned rep [PR115668]
Using std::chrono::abs is only valid if numeric_limits<rep>::is_signed
is true, so using it unconditionally made it ill-formed to format a
duration with an unsigned rep.
The duration formatter might as negate the duration itself instead of
using chrono::abs, because it already needs to check for a negative
value.
libstdc++-v3/ChangeLog:
PR libstdc++/115668
* include/bits/chrono_io.h (formatter<duration<R,P, C>::format):
Do not use chrono::abs.
* testsuite/20_util/duration/io.cc: Check formatting a duration
with unsigned rep.
Diffstat (limited to 'gcc/gimple-range-cache.h')
0 files changed, 0 insertions, 0 deletions