diff options
author | Jason Merrill <jason@redhat.com> | 2023-03-09 23:33:43 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-03-10 08:54:29 -0500 |
commit | e1c8cf9006bd278e969ab7ed35178067ce128f32 (patch) | |
tree | 0f49cb76ec63ef70886e1009496cb1b0268312a2 /gcc/testsuite/g++.dg/abi | |
parent | c4fd232f9843bb800548a906653aeb0723cdb411 (diff) | |
download | gcc-e1c8cf9006bd278e969ab7ed35178067ce128f32.zip gcc-e1c8cf9006bd278e969ab7ed35178067ce128f32.tar.gz gcc-e1c8cf9006bd278e969ab7ed35178067ce128f32.tar.bz2 |
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.
Diffstat (limited to 'gcc/testsuite/g++.dg/abi')
-rw-r--r-- | gcc/testsuite/g++.dg/abi/anon6.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/abi/anon6.C b/gcc/testsuite/g++.dg/abi/anon6.C new file mode 100644 index 0000000..7be0b0b --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/anon6.C @@ -0,0 +1,19 @@ +// PR c++/108566 +// { dg-do compile { target c++20 } } + +template<typename T> +struct wrapper1 { + union { + union { + T RightName; + }; + }; +}; + +template<auto tparam> void dummy(){} + +void uses() { + dummy<wrapper1<double>{123.0}>(); +} + +// { dg-final { scan-assembler "_Z5dummyIXtl8wrapper1IdEtlNS1_Ut_Edi9RightNametlNS2_Ut_Edi9RightNameLd405ec00000000000EEEEEEvv" } } |