[Bug c++/62096] unexpected warning overflow in implicit constant conversion

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 20 18:25:00 GMT 2016


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
         Resolution|FIXED                       |INVALID

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
I don't think this is a false positive: the initialization of val is in fact
implicitly converting from a value outside the range of int (but inside the
range of long long).  We are able to compute the constant value because the
function is constexpr.

The warning goes away if you make E signed by giving it a negative enumerator.


More information about the Gcc-bugs mailing list