https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99909
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:daa762f01d8cf932484b7df122a5e872439bc92c commit r12-3950-gdaa762f01d8cf932484b7df122a5e872439bc92c Author: Patrick Palka <ppa...@redhat.com> Date: Tue Sep 28 17:26:20 2021 -0400 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.