On Thu, Dec 08, 2016 at 01:42:44PM -0700, Martin Sebor wrote:
> On 12/08/2016 01:28 PM, Marek Polacek wrote:
> > On Thu, Dec 08, 2016 at 02:56:56PM -0500, Nathan Sidwell wrote:
> > > On 12/08/2016 01:05 PM, Jason Merrill wrote:
> > > > If the problem is the member initializer, we can diagnose that
> > > > directly rather than wait until we're in a constructor.
> > > 
> > > What about:
> > > struct Foo {
> > > int a;
> > > char ary[];
> > > Foo () : ary ("bob"){}
> > > };
> > > 
> > > ?  That ICEs in the same way.
> > 
> > My patch would make GCC to reject this too, but the new 'else' needs to
> > be removed from the patch, i.e.
> 
> Clang accepts this test case although it does reject the originally
> submitted test case with the messages below.  I think GCC should
> accept the latter case for compatibility.  If it is accepted then
> rejecting the original test case will make the array initialization
> irregular.  I think it would be nice if they both could accepted
> but I don't know how much work it would be to make it work.

It's likely late for that in any case.  I'd think we should fix the ICEs,
reject both, and maybe revisit the second case for GCC 8.

        Marek

Reply via email to