// PR sanitizer/81111 // { dg-do compile } // { dg-options "-fsanitize=shift" } template struct N { static const V m = (((V)(-1) < 0) ? (V)1 << (sizeof(V) * __CHAR_BIT__ - ((V)(-1) < 0)) : (V) 0); }; template const V N::m; template struct O { static const V m = (V)1 << sizeof(V) * __CHAR_BIT__; }; template const V O::m; void foo () { N::m; N::m; #ifdef __SIZEOF_INT128__ N<__int128>::m; N::m; #endif } void bar () { O::m; O::m; #ifdef __SIZEOF_INT128__ O<__int128>::m; O::m; #endif }