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

c++: constrained template friend matching ICE [PR105064]

Here during declaration matching for the two constrained template
friends, we crash from maybe_substitute_reqs_for because the second
friend doesn't yet have DECL_TEMPLATE_INFO set (we're being called
indirectly from push_template_decl).

As far as I can tell, this situation happens only when declaring a
constrained template friend within a non-template class (as in the
testcase), in which case the substitution would be a no-op anyway.
So this patch rearranges maybe_substitute_reqs_for to gracefully
handle missing DECL_TEMPLATE_INFO by just skipping the substitution.

	PR c++/105064

gcc/cp/ChangeLog:

	* constraint.cc (maybe_substitute_reqs_for): Don't assume
	DECL_TEMPLATE_INFO is available.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-friend9.C: New test.
parent cccbb776
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