[Bug c++/101767] [11 Regression] Aggregate initialization fails for struct that has both unnamed struct and union fields

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 12 21:14:32 GMT 2022


--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill


commit r10-10718-g846bff4d4659d9b2026da574194599f38a00cc79
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 18 14:36:19 2022 -0400

    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


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


            * g++.dg/ext/anon-struct10.C: New test.

More information about the Gcc-bugs mailing list