]> 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>
Mon, 28 Mar 2022 19:12:13 +0000 (15:12 -0400)
commit450e82794245c49248711f1479c491d84cb46c57
tree2a53db48f90a559818ca984168e1fbe97c1208f7
parent3bf2e1bfc9858516e028137b313e4c689b0c8cd4
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.c (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.c
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]