[Bug c++/57555] Warning on negation of constexpr uint8_t being assigned to uint8_t
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jun 7 12:30:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57555
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The standard says that ~foo has type int and value -256, so assigning it to
uint8_t changes the value, so the warning is correct.
The warning is only given when foo is constant because otherwise the value of
~foo is not a compile-time constant.
More information about the Gcc-bugs
mailing list