On Wed, 26 Feb 2025, Jakub Jelinek wrote:

> Hi!
> 
> r15-209 allowed flexible array members inside of unions, but as the
> following testcase shows, not everything has been adjusted for that.
> Unlike structures, in unions flexible array member (as an extension)
> can be any of the members, not just the last one, as in union all
> members are effectively last.
> The first hunk is about an ICE on the initialization of the FAM
> in union which is not the last FIELD_DECL with a string literal,
> the second hunk just formatting fix, third hunk fixes a bug in which
> we were just throwing away the initializers (except for with string literal)
> of FAMs in unions which aren't the last FIELD_DECL, and the last hunk
> is to diagnose FAM errors in unions the same as for structures, in
> particular trying to initialize a FAM with non-constant or initialization
> in nested context.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to