c++: variadic class template placeholder deduction [PR97134]
authorPatrick Palka <ppalka@redhat.com>
Tue, 13 Apr 2021 03:22:03 +0000 (23:22 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 13 Apr 2021 03:22:03 +0000 (23:22 -0400)
commitc755e1b3eadaf1c7e751a2c7ce1d418c6db8463a
tree6c05c93bba896feb39bfe252e6761351c83877bf
parent59d9aa6d2efe7c52b6a986eb3e1977c1fb3c5753
c++: variadic class template placeholder deduction [PR97134]

do_class_deduction handles specially the case where we're deducing one
placeholder from another equivalent one, but here the initializer passed
to do_class_deduction is wrapped in an EXPR_PACK_EXPANSION (we're being
called from unify during get_partial_spec_bindings).  This patch makes
do_class_deduction look through EXPR_PACK_EXPANSIONs so that we detect
this case as well.

gcc/cp/ChangeLog:

PR c++/97134
* pt.c (do_class_deduction): Look through EXPR_PACK_EXPANSION
when checking if the initializer is an equivalent class
placeholder template parameter.

gcc/testsuite/ChangeLog:

PR c++/97134
* g++.dg/cpp2a/nontype-class43.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/nontype-class43.C [new file with mode: 0644]