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: "gdr at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2006 01:17:40 -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 #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