c++: matching deduced template template parameters [PR67829]
authorPatrick Palka <ppalka@redhat.com>
Thu, 10 Jun 2021 22:31:21 +0000 (18:31 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 10 Jun 2021 22:31:21 +0000 (18:31 -0400)
commitedec2660ff4890ecf8cc191f7c92cf527de51fe2
tree697cc07ce68ac9aba7e9d0d61cd12db9662b2860
parent206db06ee380f490db0293af4ea7a4d590abd78c
c++: matching deduced template template parameters [PR67829]

During deduction, when the template of the argument for a bound ttp
is a template template parameter, we need to consider the
TEMPLATE_TEMPLATE_PARAMETER for matching rather than the TEMPLATE_DECL
thereof, because the canonical form of a template template parameter as
a template argument is the former tree, not the latter.

PR c++/67829

gcc/cp/ChangeLog:

* pt.c (unify) <case BOUND_TEMPLATE_TEMPLATE_PARM>: When
the TEMPLATE_DECL of a BOUND_TEMPLATE_TEMPLATE_PARM argument is
a template template parameter, adjust to the
TEMPLATE_TEMPLATE_PARAMETER before falling through.

gcc/testsuite/ChangeLog:

* g++.dg/template/ttp34.C: New test.
* g++.dg/template/ttp34a.C: New test.
* g++.dg/template/ttp34b.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/template/ttp34.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/ttp34a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/ttp34b.C [new file with mode: 0644]