[Bug c++/67047] GCC accepts ill-formed program with enumerator not representable in uintmax_t

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 29 00:18:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67047

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the enum is an unsigned type so UINTMAX_MAX +1 is 0 as it is always
representable due to the rules of unsigned types and wrapping.  Unless I
miss-understand how this is supposed to work and the wrapping rules for
unsigned types don't come into play.



More information about the Gcc-bugs mailing list