You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CWG2714 [over.match.class.deduct] implicit deduction guide wording does not inherit important properties from the parameter-declaration-clause of a constructor #290
The types of the function parameters are those of the constructor.
... but does not say that default arguments are inherited, and likewise does not say that the deduction guide is variadic if the constructor is variadic.
Similar issues arise with constraints on the constructor.
Suggested resolution:
Change in [over.match.class.deduct]/1:
[...]
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 are the associated constraints of C followed by 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.]
- The types of the function parameters are thoseparameter-declaration-clause is that of the constructor.
[...]
For each deduction-guide, a function or function template with the following properties:
- The explicit-specifier and template parameterstemplate-head, if any, and function parametersparameter-declaration-clause are those of the deduction-guide.
- The return type is the simple-template-id of the deduction-guide.
Aside: should deduction-guides allow a trailing requires-clause? (GCC and MSVC allow this; Clang and the grammar do not.)