This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/72775] [6/7 Regression] internal compiler error: in finish_expr_stmt, at cp/semantics.c:677
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Aug 2016 17:25:47 +0000
- Subject: [Bug c++/72775] [6/7 Regression] internal compiler error: in finish_expr_stmt, at cp/semantics.c:677
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-72775-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72775
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #3)
> (In reply to Marek Polacek from comment #1)
> > But before r233183 this code compiled fine.
>
> It didn't do what one would expect at runtime, though, and neither did a
> program that used the aggregate initialization (i.e., struct S { bool b;
> char a[]; } s = { 1, "foo" };) because it treated the flexible array member
> as a zero-length array. With the flexible array member improvements
> committed in 6.0, GCC accepts the latter, so it seems that the original test
> case should be accepted as well, as an extension. I.e., I suggest to treat
> this as ice-on-valid code.
But the initialization happens in the default constructor, whereas allocating
space for the object happens before the constructor. I don't think we should
try to support initialization of a flexible array member in a constructor.