Skip to content
Snippets Groups Projects
Commit cd5baeb4 authored by Patrick Palka's avatar Patrick Palka
Browse files

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.
parent ec62dc95
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment