This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52964] No warning on negative array size in template instantatiation
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Apr 2012 23:16:35 +0000
- Subject: [Bug c++/52964] No warning on negative array size in template instantatiation
- Auto-submitted: auto-generated
- References: <bug-52964-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52964
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu.org
--- Comment #2 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-04-12 23:16:35 UTC ---
And with trunk we print:
pr52964.cc: In instantiation of âstruct S1<4>â:
pr52964.cc:2:49: required from âstruct S2<int>â
pr52964.cc:3:45: required from âvoid foo(T) [with T = int]â
pr52964.cc:4:21: required from here
pr52964.cc:1:43: error: size of array is negative
template <int N> struct S1 { int arr[N - 5]; };
^
We could easily print the caret for each line. And the locations could be much
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?