https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103714
--- Comment #2 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:30c286aa9377850c64aa35f5845a59d321a44be0 commit r12-6063-g30c286aa9377850c64aa35f5845a59d321a44be0 Author: Patrick Palka <ppa...@redhat.com> Date: Sun Dec 19 12:10:16 2021 -0500 c++: local_specializations and recursive constrained fn [PR103714] Here during constraint checking for the inner call to A<0>::f<0>, substitution into the PARM_DECL d in the atomic constraint yields the wrong local specialization because local_specializations at this point is nonempty, and contains specializations for the caller A<0>::f<1>. This patch makes us call push_to_top_level during satisfaction, which'll temporarily clear local_specializations for us. PR c++/103714 gcc/cp/ChangeLog: * constraint.cc (satisfy_declaration_constraints): Do push_to_top_level and pop_from_top_level around the call to satisfy_normalized_constraints. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-uneval5.C: New test.