gcc/libstdc++-v3/include/tr2
Jonathan Wakely 0fa5c0340f libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399]
The shift operations for dynamic_bitset fail to zero out words where the
non-zero bits were shifted to a completely different word.

For a right shift we don't need to sanitize the unused bits in the high
word, because we know they were already clear and a right shift doesn't
change that.

libstdc++-v3/ChangeLog:

	PR libstdc++/115399
	* include/tr2/dynamic_bitset (operator>>=): Remove redundant
	call to _M_do_sanitize.
	* include/tr2/dynamic_bitset.tcc (_M_do_left_shift): Zero out
	low bits in words that should no longer be populated.
	(_M_do_right_shift): Likewise for high bits.
	* testsuite/tr2/dynamic_bitset/pr115399.cc: New test.

(cherry picked from commit bd3a312728)
2024-10-04 10:09:15 +01:00
..
bool_set Update copyright years. 2023-01-16 11:52:17 +01:00
bool_set.tcc Update copyright years. 2023-01-16 11:52:17 +01:00
dynamic_bitset libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399] 2024-10-04 10:09:15 +01:00
dynamic_bitset.tcc libstdc++: Fix std::tr2::dynamic_bitset shift operations [PR115399] 2024-10-04 10:09:15 +01:00
ratio Update copyright years. 2023-01-16 11:52:17 +01:00
type_traits libstdc++: Guard tr2::bases and tr2::direct_bases with __has_builtin 2024-02-16 15:11:09 +00:00