aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-11-17 21:57:52 -0500
committerJason Merrill <jason@redhat.com>2023-12-01 16:08:35 -0500
commit37e6c9bd99575752b7122c5d76aa2cf021deb93c (patch)
tree4550c155ed84c58f4fb0421575f07c7b1a314641 /gcc/cp/mangle.cc
parentc3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6 (diff)
downloadgcc-37e6c9bd99575752b7122c5d76aa2cf021deb93c.zip
gcc-37e6c9bd99575752b7122c5d76aa2cf021deb93c.tar.gz
gcc-37e6c9bd99575752b7122c5d76aa2cf021deb93c.tar.bz2
c++: mangling for CTAD placeholder
Per https://github.com/itanium-cxx-abi/cxx-abi/issues/109 mangle a C++17 CTAD placeholder as its template. gcc/cp/ChangeLog: * mangle.cc (write_type): Mangle placeholder as its template. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-class4.C: Specify ABI v18. * g++.dg/cpp2a/nontype-class4a.C: New test.
Diffstat (limited to 'gcc/cp/mangle.cc')
-rw-r--r--gcc/cp/mangle.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 8a44b11..0684f0e 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -2539,6 +2539,16 @@ write_type (tree type)
case TEMPLATE_TYPE_PARM:
if (is_auto (type))
{
+ if (template_placeholder_p (type)
+ && abi_check (19))
+ {
+ /* ABI #109: placeholder is mangled as its template. */
+ type = CLASS_PLACEHOLDER_TEMPLATE (type);
+ if (find_substitution (type))
+ return;
+ write_name (type, 0);
+ break;
+ }
if (AUTO_IS_DECLTYPE (type))
write_identifier ("Dc");
else