https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96830
--- Comment #13 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:cd5baeb4489b6a953abbc7f02fea457fd9ed2f83 commit r13-6677-gcd5baeb4489b6a953abbc7f02fea457fd9ed2f83 Author: Patrick Palka <ppa...@redhat.com> Date: Tue Mar 14 19:14:29 2023 -0400 c++: redeclaring member of constrained class template [PR96830] An out-of-line definition of a member of a constrained class template needs to repeat the template's constraints, but it turns out we don't verify anywhere that the two sets of constraints match. This patch adds such a check to push_template_decl, nearby a similar consistency check for the template parameter list lengths. PR c++/96830 gcc/cp/ChangeLog: * pt.cc (push_inline_template_parms_recursive): Set TEMPLATE_PARMS_CONSTRAINTS. (push_template_decl): For an out-of-line declaration, verify constraints for each enclosing template scope match those of the original template declaratation. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-class5.C: New test. * g++.dg/cpp2a/concepts-class5a.C: New test.