This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82893] Bad diagnostic on negative sized array
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Nov 2017 03:29:10 +0000
- Subject: [Bug c++/82893] Bad diagnostic on negative sized array
- Auto-submitted: auto-generated
- References: <bug-82893-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82893
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-11-08
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the report. I agree that the error could stand to be improved to be
more informative so I confirm the request.
Intel ICC prints the following:
prog.cc(10): error: array is too large
char pad[8 - sizeof(T)];
^
detected during instantiation of class "Baz<T> [with T=Bar]" at line
15
prog.cc(15): error: static assertion failed with ""
static_assert(sizeof(Baz<Bar>) == 8, "");
^
and Visual C++:
prog.cc(10): error C2118: negative subscript
prog.cc(15): note: see reference to class template instantiation 'Baz<Bar>'
being compiled
prog.cc(15): error C2338:
(though I'm not sure what the second error is all about).