After the application of CWG2369, satisfaction for a trailing requires-clause is checked prior to substitution into the function type. [temp.deduct.general]/5:
[...] If the function template has associated constraints ([temp.constr.decl]), those constraints are checked for satisfaction ([temp.constr.constr]). [...] If type deduction has not yet failed, then all uses of template parameters in the function type are replaced with the corresponding deduced or default argument values.
But the associated constraints can refer to the parameters:
Among implementations that implement CWG2369, there seems to be no implementation variance: function parameters should be instantiated when they are needed by a satisfaction check of an atomic constraint or (recursively) by another function parameter.
Full name of submitter (unless configured in github; will be published with the issue):
Reference (section label): [temp.deduct.general]
Link to reflector thread (if any): https://lists.isocpp.org/core/2023/07/14525.php
Issue description:
After the application of CWG2369, satisfaction for a trailing requires-clause is checked prior to substitution into the function type. [temp.deduct.general]/5:
But the associated constraints can refer to the parameters:
Suggested resolution:
Among implementations that implement CWG2369, there seems to be no implementation variance: function parameters should be instantiated when they are needed by a satisfaction check of an atomic constraint or (recursively) by another function parameter.