[Bug c++/11856] unsigned warning in template
gdr at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jan 23 01:17:00 GMT 2006
------- Comment #10 from gdr at gcc dot gnu dot org 2006-01-23 01:17 -------
> > With this code:
> > template <typename t>
> > void f(t c) {
> > assert(0 <= c and c <= 2);
> > }
> > int main() {
> > f<unsigned char>(5);
> > }
> > I only get a warning on instantiation.
> >
> >
>
> I see, I oversimplified the problem a bit. Here is a better example:
> ------------------------------
> #include <cassert>
> template <typename Int, Int D>
> void f(Int x) {
> assert(0 <= x and x <= D);
> }
This kind of template tends to be common place for certain catgories
of codes. It is annoying. This also manifests in gcjx.
I don't know which way to go yet, but certainly it should be
controlable by -Walways-true.
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org, gdr at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
More information about the Gcc-bugs
mailing list