From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26019 invoked by alias); 12 Apr 2012 23:17:03 -0000 Received: (qmail 26007 invoked by uid 22791); 12 Apr 2012 23:17:02 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 23:16:50 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52964] No warning on negative array size in template instantatiation Date: Thu, 12 Apr 2012 23:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00947.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52964 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-04-12 23:16:35 UTC --- And with trunk we print: pr52964.cc: In instantiation of =E2=80=98struct S1<4>=E2=80=99: pr52964.cc:2:49: required from =E2=80=98struct S2=E2=80=99 pr52964.cc:3:45: required from =E2=80=98void foo(T) [with T =3D int]=E2= =80=99 pr52964.cc:4:21: required from here pr52964.cc:1:43: error: size of array is negative template struct S1 { int arr[N - 5]; }; ^ We could easily print the caret for each line. And the locations could be m= uch better. I also like more the order of Clang and the extra info about what each thing is, but we would have to convince Gabriel and/or Jason. David, what else do you see that could be improved?