From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24124 invoked by alias); 23 Jan 2006 01:17:42 -0000 Received: (qmail 24096 invoked by uid 48); 23 Jan 2006 01:17:40 -0000 Date: Mon, 23 Jan 2006 01:17:00 -0000 Message-ID: <20060123011740.24095.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/11856] unsigned warning in template In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "gdr at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg02308.txt.bz2 List-Id: ------- Comment #10 from gdr at gcc dot gnu dot org 2006-01-23 01:17 ------- > > With this code: > > template > > void f(t c) { > > assert(0 <= c and c <= 2); > > } > > int main() { > > f(5); > > } > > I only get a warning on instantiation. > > > > > > I see, I oversimplified the problem a bit. Here is a better example: > ------------------------------ > #include > template > 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