On Thu, Mar 22, 2018 at 4:05 AM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
> Hi,
>
> yesterday I figured out that this issue is in fact orthogonal to possible
> improvements to maybe_deduce_size_from_array_init, indeed it happens also
> when we are not deducing the size. The testcase is very similar to that
> recently submitted for c++/78345, which led Jason to add the bit of
> additional checking around the middle of build_aggr_init. Since we did
> already have a similar check a bit earlier - not requiring the computation
> of from_array - I added one for VAR_DECLs too in the same place and
> tweaked/improved a bit the error message in the process (a few greps
> revealed that we don't seem to have any other generic error message using
> the form "bad ..."), consistently with the diagnostic that we already
> provide for, eg, a simple
>
>     int a[2] = a;
>
> FYI, I must also add that entire testsuite doesn't have a test triggering
> the existing TREE_CODE (init) == TREE_LIST check, and failed so far to
> construct one... (many such issues are normally catched by digest_init).
> Tested x86_64-linux.

That whole block is there to support this sort of initialization, as
an ancient extension.  Since it isn't generally allowed, and is
causing trouble, let's remove it and reject anything that isn't an
initializer list.

Jason

Reply via email to