c++: ttp matching with constrained auto parm [PR99909]
authorPatrick Palka <ppalka@redhat.com>
Tue, 28 Sep 2021 21:26:20 +0000 (17:26 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 28 Sep 2021 21:26:20 +0000 (17:26 -0400)
commitdaa762f01d8cf932484b7df122a5e872439bc92c
tree063ac2526b95709c1d3f05da5c45acba98d6f260
parent2fcfc7d66862c67677f0e1c46391292d5a21a567
c++: ttp matching with constrained auto parm [PR99909]

Here, when unifying TT with S, processing_template_decl is unset, and
this foils the dependence checks in do_auto_deduction for avoiding
checking constraints on an auto when the initializer is dependent.

This patch fixes this by making sure processing_template_decl is set
around the call to unify from coerce_template_template_parms; this seems
sensible because we're unifying one set of template parameters with
another, so we're dealing with templated trees throughout.

PR c++/99909

gcc/cp/ChangeLog:

* pt.c (coerce_template_template_parms): Keep
processing_template_decl set around the call to unify as well.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-ttp3.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/concepts-ttp3.C [new file with mode: 0644]