struct-init: Correctly parse unnamed member initializers
commit9e86ebee944e7fc480fe49bf4f4f406aab672200
authorMichael Matz <matz@suse.de>
Mon, 1 Aug 2016 20:11:49 +0000 (1 22:11 +0200)
committerMichael Matz <matz@suse.de>
Thu, 15 Dec 2016 16:47:09 +0000 (15 17:47 +0100)
tree159bf595663596d64aac563929c125e1c4fdd5ca
parent21da73c383f84b29c04a504d3d7ec56008029db6
struct-init: Correctly parse unnamed member initializers

For
  union U { struct {int a,b}; int c; };
  union U u = {{ 1, 2, }};
The unnamed first member of union U needs to actually exist in the
structure so initializer parsing isn't confused about the double braces.
That means also the a and b members must be part of _that_, not of
union U directly.  Which in turn means we need to do a bit more work
for field lookup.

See the testcase extension for more things that need to work.
tccgen.c
tests/tests2/86-struct-init.c
tests/tests2/86-struct-init.expect