diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-04-24 13:39:54 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-04-24 13:39:54 -0400 |
commit | 83470a5cd4c3d233e1d55b5e5553e1b9c553bf28 (patch) | |
tree | a49d6b2ed234bd9695168943c220707ffa22d933 /gcc | |
parent | f1f5cbaa3f716fcb472dee52b8a159ccd5576828 (diff) | |
download | gcc-83470a5cd4c3d233e1d55b5e5553e1b9c553bf28.zip gcc-83470a5cd4c3d233e1d55b5e5553e1b9c553bf28.tar.gz gcc-83470a5cd4c3d233e1d55b5e5553e1b9c553bf28.tar.bz2 |
libstdc++: Fix __max_diff_type::operator>>= for negative values
This patch fixes sign bit propagation when right-shifting a negative
__max_diff_type value by more than one, a bug that our existing test
coverage didn't expose until r14-159-g03cebd304955a6 fixed the front
end's 'signed typedef-name' handling that the test relies on (which is
a non-standard extension to the language grammar).
libstdc++-v3/ChangeLog:
* include/bits/max_size_type.h (__max_diff_type::operator>>=):
Fix propagation of sign bit.
* testsuite/std/ranges/iota/max_size_type.cc: Avoid using the
non-standard 'signed typedef-name'. Add some compile-time tests
for right-shifting a negative __max_diff_type value by more than
one.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions