Created attachment 53064 [details] test.cpp GCC version: G++ 11.2.0 system type: Linux 5.10.105-1-MANJARO Mar 2022 x86_64 GNU/Linux g++ -m64 -Wall -Wextra -c test.cpp -o /dev/null No warning or errors reported (except static_assert violation). Affected std::extent and std::extent_v for big arrays. -mcmodel=medium has no effect.
Removing the include: using size_t = decltype(sizeof(0)); template<typename> struct extent { static constexpr size_t value = 0; }; template<typename T, size_t size> struct extent<T[size]> { static constexpr size_t value = size; }; static_assert(extent<char[1ULL << 32]>::value != 0, ""); // fails ----- CUT ---- GCC 7 and before used to error out about the overflow: <source>: In substitution of 'template<class T, long unsigned int size> struct extent<T [size]> [with T = char; long unsigned int size = 0]': <source>:15:39: required from here <source>:15:39: error: overflow in constant expression static_assert(extent<char[1ULL << 32]>::value != 0, ""); // fails ^~ clang accepts the code as being valid ...