diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-06-03 09:29:12 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-06-03 09:29:12 -0400 |
commit | 43c013df02fdb07f9b7a5e7e6669e6d69769d451 (patch) | |
tree | a9021ab5d91e98311f65e0267fbe7ac76420d734 /gcc/expr.cc | |
parent | df4f95dbd4764ffc1e8270e5b3c0fd71b6724562 (diff) | |
download | gcc-43c013df02fdb07f9b7a5e7e6669e6d69769d451.zip gcc-43c013df02fdb07f9b7a5e7e6669e6d69769d451.tar.gz gcc-43c013df02fdb07f9b7a5e7e6669e6d69769d451.tar.bz2 |
c++: don't substitute TEMPLATE_PARM_CONSTRAINTS [PR100374]
This patch makes us avoid substituting into the TEMPLATE_PARM_CONSTRAINTS
of each template parameter except as necessary for declaration matching,
like we already do for the other constituent constraints of a declaration.
This patch also improves the CA104 implementation of explicit
specialization matching of a constrained function template inside a
class template, by considering the function's combined constraints
instead of just its trailing constraints. This allows us to correctly
handle the first three explicit specializations in concepts-spec2.C
below, but because we compare the constraints as a whole, it means we
incorrectly accept the fourth explicit specialization which writes #3's
constraints in a different way. For complete correctness here,
determine_specialization should use tsubst_each_template_parm_constraints
and template_parameter_heads_equivalent_p.
PR c++/100374
gcc/cp/ChangeLog:
* pt.cc (determine_specialization): Compare overall constraints
not just the trailing constraints.
(tsubst_each_template_parm_constraints): Define.
(tsubst_friend_function): Use it.
(tsubst_friend_class): Use it.
(tsubst_template_parm): Don't substitute TEMPLATE_PARM_CONSTRAINTS.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-spec2.C: New test.
* g++.dg/cpp2a/concepts-template-parm11.C: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions