aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constraint.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-08-18 18:24:53 -0400
committerJason Merrill <jason@redhat.com>2023-08-22 14:35:47 -0400
commitf40d24cda74da5ed8c9b88641e55138c066c932f (patch)
treef16720d31686edab099dd81f5ac54ba974b31b2e /gcc/cp/constraint.cc
parent810bcc00156cefce7ad40fc9d8de6e43c3a04450 (diff)
downloadgcc-f40d24cda74da5ed8c9b88641e55138c066c932f.zip
gcc-f40d24cda74da5ed8c9b88641e55138c066c932f.tar.gz
gcc-f40d24cda74da5ed8c9b88641e55138c066c932f.tar.bz2
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.
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r--gcc/cp/constraint.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index 8cf0f2d..c9e4e70 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -1339,7 +1339,7 @@ maybe_substitute_reqs_for (tree reqs, const_tree decl)
if (DECL_UNIQUE_FRIEND_P (decl) && DECL_TEMPLATE_INFO (decl))
{
tree tmpl = DECL_TI_TEMPLATE (decl);
- tree outer_args = outer_template_args (tmpl);
+ tree outer_args = outer_template_args (decl);
processing_template_decl_sentinel s;
if (PRIMARY_TEMPLATE_P (tmpl)
|| uses_template_parms (outer_args))