diff options
author | Jason Merrill <jason@redhat.com> | 2022-06-23 16:04:02 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-06-23 17:16:17 -0400 |
commit | d610ae121e8ecd738de4dc01e6ac11ecf7c2327e (patch) | |
tree | efedfa834e6a179ccb96ea80f0537aa2870bc97e /gcc/d/expr.cc | |
parent | b00b95198e6720eb23a2618870d67800f6180fdd (diff) | |
download | gcc-d610ae121e8ecd738de4dc01e6ac11ecf7c2327e.zip gcc-d610ae121e8ecd738de4dc01e6ac11ecf7c2327e.tar.gz gcc-d610ae121e8ecd738de4dc01e6ac11ecf7c2327e.tar.bz2 |
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.
This avoids some redundant errors on desig4.C because we stop setting
CONSTRUCTOR_IS_DESIGNATED_INIT on _Complex CONSTRUCTORs where it's
nonsense.
PR c++/105925
gcc/cp/ChangeLog:
* decl.cc (reshape_init_array_1): Set
CONSTRUCTOR_IS_DESIGNATED_INIT here.
(reshape_init_class): And here.
(reshape_init): Not here.
gcc/testsuite/ChangeLog:
* g++.dg/ext/desig4.C: Remove extra errors.
* g++.dg/cpp2a/desig26.C: New test.
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions