c++: class NTTP and nested anon union [PR108566]
commite1c8cf9006bd278e969ab7ed35178067ce128f32
authorJason Merrill <jason@redhat.com>
Fri, 10 Mar 2023 04:33:43 +0000 (9 23:33 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 10 Mar 2023 13:54:29 +0000 (10 08:54 -0500)
tree0f49cb76ec63ef70886e1009496cb1b0268312a2
parentc4fd232f9843bb800548a906653aeb0723cdb411
c++: class NTTP and nested anon union [PR108566]

We were failing to come up with the name for the anonymous union.  It seems
like unfortunate redundancy, but the ABI does say that the name of an
anonymous union is its first named member.

PR c++/108566

gcc/cp/ChangeLog:

* mangle.cc (anon_aggr_naming_decl): New.
(write_unqualified_name): Use it.

gcc/testsuite/ChangeLog:

* g++.dg/abi/anon6.C: New test.
gcc/cp/mangle.cc
gcc/testsuite/g++.dg/abi/anon6.C [new file with mode: 0644]