]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: designator and anon struct [PR101767]
authorJason Merrill <jason@redhat.com>
Fri, 18 Mar 2022 18:36:19 +0000 (14:36 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 12 May 2022 21:14:12 +0000 (17:14 -0400)
commit846bff4d4659d9b2026da574194599f38a00cc79
tree9a939bf5b14f1bec72cc44ff7366cd2362267739
parent6ec022c8df4791d322b10bec56099f8d6ad90d22
c++: designator and anon struct [PR101767]

We found .x in the anonymous struct, but then didn't find .y there; we
should decide that means we're done with the struct rather than that the
code is wrong.

PR c++/101767

gcc/cp/ChangeLog:

* decl.c (reshape_init_class): Back out of anon struct
if a designator doesn't match.

gcc/testsuite/ChangeLog:

* g++.dg/ext/anon-struct10.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/ext/anon-struct10.C [new file with mode: 0644]