[Bug c++/82924] gcc gives no warning for comparing unsigned integer < 0 even with -Wextra enabled
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 10 20:45:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82924
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-11-10
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think that warning is simply disabled in templates, to avoid warnings about
(x < 0) which would depend on whether T is signed or unsigned, but is not a
helpful warning in general. In this case we know that (y < 0) is always an
unsigned type.
More information about the Gcc-bugs
mailing list