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

c++: normalization of non-templated return-type-req [PR100946]

Here the satisfaction cache is conflating the satisfaction value of the
two return-type-requirements because the corresponding constrained
'auto's have level 2, but they capture an empty current_template_parms.
This ultimately causes the satisfaction cache to think the type
constraint doesn't depend on the deduced type of the expression.

When normalizing the constraints on an 'auto', the assumption made by
normalize_placeholder_type_constraints is that the level of the 'auto'
is one greater than the depth of the captured current_template_parms, an
assumption which is not holding here.  So this patch just makes n_p_t_c
adjust the normalization context appropriately in this situation.

	PR c++/100946

gcc/cp/ChangeLog:

	* constraint.cc (normalize_placeholder_type_constraints): When
	normalizing a non-templated return-type-requirement, add a dummy
	level to initial_parms.

gcc/testsuite/ChangeLog:

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