c++: maybe_substitute_reqs_for fix
commitf40d24cda74da5ed8c9b88641e55138c066c932f
authorJason Merrill <jason@redhat.com>
Fri, 18 Aug 2023 22:24:53 +0000 (18 18:24 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 22 Aug 2023 18:35:47 +0000 (22 14:35 -0400)
treef16720d31686edab099dd81f5ac54ba974b31b2e
parent810bcc00156cefce7ad40fc9d8de6e43c3a04450
c++: maybe_substitute_reqs_for fix

While working on PR109751 I found that maybe_substitute_reqs_for was doing
the wrong thing for a non-template friend, substituting in the template args
of the scope's original template rather than those of the instantiation.
This didn't end up being necessary to fix the PR, but it's still an
improvement.

gcc/cp/ChangeLog:

* pt.cc (outer_template_args): Handle non-template argument.
* constraint.cc (maybe_substitute_reqs_for): Pass decl to it.
* cp-tree.h (outer_template_args): Adjust.
gcc/cp/constraint.cc
gcc/cp/cp-tree.h
gcc/cp/pt.cc