https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98625
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Note, -1 << x shifts are well defined in C++20 (assuming x < sizeof (int) * CHAR_BIT), but isn't well defined in older C++ versions. For C++11 .. C++17 in particular, x << y is UB if x < 0 or ((unsigned) x >> (sizeof (int) * CHAR_BIT - 1 - y)) > 1 (in addition to the usual y < 0 or y >= sizeof (int) * CHAR_BIT).