]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix -Wshift-count-overflow warning in std::bitset
authorJonathan Wakely <jwakely@redhat.com>
Sat, 20 Jan 2024 21:09:28 +0000 (21:09 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 31 Jan 2024 09:42:38 +0000 (09:42 +0000)
commit86302e1a76a4af29b4de401685d3822f3eb96899
treee62efdecdecbb51e693054117cf0bc9cb4071b7a
parent924137b9012cee5603482242de08fbf0b2030f6a
libstdc++: Fix -Wshift-count-overflow warning in std::bitset

This shift only happens if the unsigned long long type is wider than
unsigned long but the compiler warns when it sees the shift, without
caring if it's reachable.

Use the preprocessor to compare the sizes and just reuse _M_to_ulong()
if sizeof(long) == sizeof(long long).

libstdc++-v3/ChangeLog:

* include/std/bitset (_Base_bitset::_M_do_to_ullong): Avoid
-Wshift-count-overflow warning.
libstdc++-v3/include/std/bitset