[Bug c++/67047] GCC accepts ill-formed program with enumerator not representable in uintmax_t
anders.granlund.0 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 29 10:30:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67047
--- Comment #5 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #4)
> Yes you can verify that with
>
> static_assert( std::is_same<std::underlying_type<decltype(x)>::type,
> unsigned __int128>::value, "");
>
> I suppose there should be a diagnostic with -Wpedantic (Clang has a
> -Wenum-too-large warning).
Nice use of type traits there for the confirmation. Yes, a -Wpedantic warning
is what we want here.
I haven't tried this with the c compiler (the online compiler i'm using does
not support c mode), but this bug may exists there also.
More information about the Gcc-bugs
mailing list