c++: CTAD for less-specialized alias template [PR102529]
commitafe1f0c251d0429069c2414d4f3f14042efc174f
authorJason Merrill <jason@redhat.com>
Thu, 9 Feb 2023 20:58:35 +0000 (9 12:58 -0800)
committerJason Merrill <jason@redhat.com>
Thu, 9 Mar 2023 15:25:46 +0000 (9 10:25 -0500)
tree2b40a1943b30ad0d90ecca5a2410343bd0431dc4
parent9e6170098d5e7756e85e880f8f4cb18e885a64fd
c++: CTAD for less-specialized alias template [PR102529]

The standard was unclear what happens with the transformation of a deduction
guide if the initial template argument deduction fails for a reason other
than not deducing all the arguments; my implementation assumed that the
right thing was to give up on the deduction guide.  But in consideration of
CWG2664 this week I realized that we get a better result by just continuing
with an empty set of deductions, so the alias deduction guide is the same as
the original deduction guide plus the deducible constraint.

DR 2664
PR c++/102529

gcc/cp/ChangeLog:

* pt.cc (alias_ctad_tweaks): Continue after deduction failure.

gcc/testsuite/ChangeLog:

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