c++: Inherited constructor template arguments [PR94719]
My fix for PR94549 broke constraints_satisfied_p in the case where the inherited
constructor decl points to an instantiation of a constructor template coming
from an instantiation of a class template.
This is because the DECL_TI_ARGS of the inherited constructor decl in this case
contains only the innermost level of template arguments (those for the
constructor template), but constraint satisfaction expects to have the full set
of template arguments. This causes template argument substitution during
constraint satisfaction to fail in various ways.
On the other hand, the DECL_TI_ARGS of the DECL_INHERITED_CTOR is a full set of
template arguments but with the innermost level still in its dependent form,
which is the source of PR94549. So if we could combine these two sets of
template arguments then we'd be golden.
This patch does just that, by effectively reverting the fix for PR94549 and
instead using add_outermost_template_args to combine the template arguments of
the inherited constructor decl with those of its DECL_INHERITED_CTOR.
gcc/cp/ChangeLog:
PR c++/94719
PR c++/94549
* constraint.cc (satisfy_declaration_constraints): If the inherited
constructor points to an instantiation of a constructor template,
remember and use its attached template arguments.
gcc/testsuite/ChangeLog:
PR c++/94719
PR c++/94549
* g++.dg/cpp2a/concepts-inherit-ctor9.C: New test.