[Bug c++/105925] [11/12/13 Regression] Could not convert '{{0, 0.0}}' from '<brace-enclosed initializer list>' to 'X' since r12-954-g84fd1b5dff70cd74

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 24 00:45:27 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105925

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:553aecc570ce4ef5c751dc39b83bfbde6380f953

commit r11-10091-g553aecc570ce4ef5c751dc39b83bfbde6380f953
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jun 23 16:04:02 2022 -0400

    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.


More information about the Gcc-bugs mailing list