c++: alias ctad refinements [PR109321]
authorJason Merrill <jason@redhat.com>
Tue, 28 Mar 2023 21:42:23 +0000 (17:42 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 29 Mar 2023 02:23:51 +0000 (22:23 -0400)
commit91293ffb6af18705ab7857dc47656bdd74a9ce31
treec3e48b9b85c193244fb1c4ff8b3db4421273bbe6
parentaa8f4242efc99f24de73c59d53996f28db28c13f
c++: alias ctad refinements [PR109321]

The two hunks fix missing handling demonstrated by the two testcases: first,
if we omit one alias template parm but include another, we need to rewrite
the deduced template args to reflect the new position of the included parm.
Second, if we can't deduce any template args for a parameter pack, it is
deduced to an empty pack.

PR c++/109321
PR c++/109320

gcc/cp/ChangeLog:

* pt.cc (alias_ctad_tweaks): Rewrite deduced args.
(type_targs_deducible_from): Handle null pack deduction.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/class-deduction-alias16.C: New test.
* g++.dg/cpp2a/class-deduction-alias17.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/class-deduction-alias16.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/class-deduction-alias17.C [new file with mode: 0644]