c++: sizeof... mangling with alias template [PR95298]
commitd26f589e61a178e898d8b247042b487287ffe121
authorJason Merrill <jason@redhat.com>
Sat, 18 Nov 2023 19:35:22 +0000 (18 14:35 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 22 Dec 2023 00:19:50 +0000 (21 19:19 -0500)
treeb1c2cc9b6d39fafac1ad34663048988b1e833dc6
parent2fa122cae50cd87c1262c4ec18a783ee9bbbdaaa
c++: sizeof... mangling with alias template [PR95298]

We were getting sizeof... mangling wrong when the argument after
substitution was a pack expansion that is not a simple T..., such as
list<T>... in variadic-mangle4.C or (A+1)... in variadic-mangle5.C.  In the
former case we ICEd; in the latter case we wrongly mangled it as sZ
<expression>.

PR c++/95298

gcc/cp/ChangeLog:

* mangle.cc (write_expression): Handle v18 sizeof... bug.
* pt.cc (tsubst_pack_expansion): Keep TREE_VEC for sizeof...
(tsubst_expr): Don't strip TREE_VEC here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic-mangle2.C: Add non-member.
* g++.dg/cpp0x/variadic-mangle4.C: New test.
* g++.dg/cpp0x/variadic-mangle5.C: New test.
* g++.dg/cpp0x/variadic-mangle5a.C: New test.
gcc/cp/mangle.cc
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/variadic-mangle2.C
gcc/testsuite/g++.dg/cpp0x/variadic-mangle4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/variadic-mangle5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/variadic-mangle5a.C [new file with mode: 0644]