This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11856] unsigned warning in template
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2007 00:47:17 -0000
- Subject: [Bug c++/11856] unsigned warning in template
- References: <bug-11856-781@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from manu at gcc dot gnu dot org 2007-01-17 00:47 -------
#include <cassert>
template <typename Int, Int D>
void f(Int x) {
assert(0 <= x and x <= D);
}
int main() {
f<unsigned char, 2>(5);
f<signed char, 2>(5);
}
We don't emit a warning when instantiated as a signed char, so everything boils
down to having an option to disable the warning, doesn't it?
There is a patch pending review for that:
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01120.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856