[Bug c++/82893] Bad diagnostic on negative sized array
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 8 03:29:00 GMT 2017
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).
More information about the Gcc-bugs
mailing list