c++: passing one ttp to another [PR108179]
commit3ea64aad06a2b32739028bae03b9b9a5691d2d30
authorJason Merrill <jason@redhat.com>
Fri, 10 Mar 2023 19:55:27 +0000 (10 14:55 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 15 Mar 2023 12:44:42 +0000 (15 08:44 -0400)
treed8b6869075ae97c994c340195dafd0b146ce550f
parent5ccbf162511b896672a72934c3cafd37a42d6438
c++: passing one ttp to another [PR108179]

I kept trying to improve our choice of how many levels of outer_args to add,
when really the problem was that outer_args are for PARM and for this
reverse deduction we should be adding the outer arguments for ARG.

I spent quite a while trying to get DECL_CONTEXT set consistently on
template template parameters that have gone through
reduce_template_parm_level before I realized I could just use
current_scope().

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

gcc/cp/ChangeLog:

* pt.cc (coerce_template_template_parms): Use args from
DECL_CONTEXT (arg_tmpl) instead of outer_args.

gcc/testsuite/ChangeLog:

* g++.dg/template/ttp35.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/template/ttp35.C [new file with mode: 0644]