]> gcc.gnu.org Git - gcc.git/commit
c++: anon union designated init [PR105925]
authorJason Merrill <jason@redhat.com>
Thu, 23 Jun 2022 20:04:02 +0000 (16:04 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 24 Jun 2022 00:45:14 +0000 (20:45 -0400)
commit553aecc570ce4ef5c751dc39b83bfbde6380f953
treec81455a6570e841b173a0df6bf7c6849b4f46474
parent89e63b910250d1bb14490749e63af4845c18248d
c++: anon union designated init [PR105925]

This testcase was failing because CONSTRUCTOR_IS_DESIGNATED_INIT wasn't
getting set on the introduced CONSTRUCTOR for the anonymous union, and
build_aggr_conv uses that flag to decide whether to pay attention to the
indexes of the CONSTRUCTOR.  So set the flag when we see a designator rather
than relying on copying it from another CONSTRUCTOR.

PR c++/105925

gcc/cp/ChangeLog:

* decl.c (reshape_init_array_1): Set
CONSTRUCTOR_IS_DESIGNATED_INIT here.
(reshape_init_class): And here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/desig26.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp2a/desig26.C [new file with mode: 0644]
This page took 0.0611120000000001 seconds and 6 git commands to generate.