aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-09-18 17:20:29 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-09-22 17:45:06 +0100
commit482e651f5750e4648ade90e32ed45b094538e7f8 (patch)
treeaa1734619b465e73ef54ad98f40bd862fd00bc8f /gcc
parentb6463161c3cd0b1f764697290d9569c7153b8a5b (diff)
downloadgcc-482e651f5750e4648ade90e32ed45b094538e7f8.zip
gcc-482e651f5750e4648ade90e32ed45b094538e7f8.tar.gz
gcc-482e651f5750e4648ade90e32ed45b094538e7f8.tar.bz2
libstdc++: Fix formatting of most negative chrono::duration [PR116755]
When formatting chrono::duration<signed-integer-type, P>::min() we were causing undefined behaviour by trying to form the negative of the most negative value. If we convert negative durations with integer rep to the corresponding unsigned integer rep then we can safely represent all values. libstdc++-v3/ChangeLog: PR libstdc++/116755 * include/bits/chrono_io.h (formatter<duration<R,P>>::format): Cast negative integral durations to unsigned rep. * testsuite/20_util/duration/io.cc: Test the most negative integer durations.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions