This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-10-26
[Accepted as a DR at the March, 2024 meeting.]
Subclause 12.2.2.9 [over.match.class.deduct] bullet 1.1.2 specifies:
- The types of the function parameters are those of the constructor.
However, this does not consider default arguments or variadic constructors.
Proposed resolution (approved by CWG 2023-04-28):
(This also resolves issue 2628.)
Change in 12.2.2.9 [over.match.class.deduct] paragraph 1 as follows:
- If C is defined, for each constructor of C, a function template with the following properties:
- The template parameters are the template parameters of C followed by the template parameters (including default template arguments) of the constructor, if any.
- The associated constraints (13.5.3 [temp.constr.decl]) are the conjunction of the associated constraints of C and the associated constraints of the constructor, if any. [ Note: A constraint-expression in the template-head of C is checked for satisfaction before any constraints from the template-head or trailing-requires-clause of the constructor. -- end note ]
- The
types of the function parameters are thoseparameter-declaration-clause is that of the constructor.- The return type is the class template specialization designated by C and template arguments corresponding to the template parameters of C.
- If C is not defined or does not declare any constructors, an additional function template derived as above from a hypothetical constructor C().
- An additional function template derived as above from a hypothetical constructor C(C), called the copy deduction candidate.
- For each deduction-guide, a function or function template with the following properties:
- The
template parameterstemplate-head, if any, andfunction parametersparameter-declaration-clause are those of the deduction-guide.- The return type is the simple-template-id of the deduction-guide.