aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-03-26 20:10:19 -0400
committerJason Merrill <jason@redhat.com>2022-03-28 09:35:58 -0400
commit71e1db540c01a13b01fae054c92878a79252b471 (patch)
tree0e815254322a394d0b9745ec8f2e2704aab34aa6 /gcc/cp/mangle.cc
parent07be8f8da4c6840a1fd6b2229b147e50cc6f03dc (diff)
downloadgcc-71e1db540c01a13b01fae054c92878a79252b471.zip
gcc-71e1db540c01a13b01fae054c92878a79252b471.tar.gz
gcc-71e1db540c01a13b01fae054c92878a79252b471.tar.bz2
c++: mangling union{1} in template [PR104847]
My implementation of union non-type template arguments in r11-2016 broke braced casts of union type, because they are still in syntactic (undigested) form. PR c++/104847 gcc/cp/ChangeLog: * mangle.cc (write_expression): Don't write a union designator when undigested. gcc/testsuite/ChangeLog: * g++.dg/abi/mangle-union1.C: New test.
Diffstat (limited to 'gcc/cp/mangle.cc')
-rw-r--r--gcc/cp/mangle.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index dbcec0a..eb53e0e 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -3363,7 +3363,7 @@ write_expression (tree expr)
{
if (i > last_nonzero)
break;
- if (TREE_CODE (etype) == UNION_TYPE)
+ if (!undigested && TREE_CODE (etype) == UNION_TYPE)
{
/* Express the active member as a designator. */
write_string ("di");