]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: TTP in member alias template [PR104107]
authorJason Merrill <jason@redhat.com>
Thu, 10 Feb 2022 22:57:38 +0000 (17:57 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 15 Feb 2022 05:06:38 +0000 (00:06 -0500)
commit2c3309e3d0f5cb8f298f7604848d115f0992e04f
tree77fbd71095002ce75119a13970fbc14dd801fa8e
parent1f8a09d2f3c69fff32729c4fa0680c4621babb83
c++: TTP in member alias template [PR104107]

In the first testcase, coerce_template_template_parms was adding too much of
outer_args when coercing to match P's template parameters, so that when
substituting into the 'const T&' parameter we got an unrelated template
argument for T.  We should only add outer_args when the argument template is
a nested template.

PR c++/104107
PR c++/95036

gcc/cp/ChangeLog:

* pt.cc (coerce_template_template_parms): Take full parms.
Avoid adding too much of outer_args.
(coerce_template_template_parm): Adjust.
(template_template_parm_bindings_ok_p): Adjust.
(convert_template_argument): Adjust.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/alias-decl-ttp2.C: New test.
* g++.dg/cpp1z/ttp2.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/alias-decl-ttp2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/ttp2.C [new file with mode: 0644]