Closed
Description
Reference (section label): [over.match.class.deduct]
Link to reflector thread (if any): https://lists.isocpp.org/core/2017/02/1752.php
Issue description:
[over.match.class.deduct]/1.1.2 says:
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.]
- Thetypes 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 andtemplate 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.
Aside: should deduction-guides allow a trailing requires-clause? (GCC and MSVC allow this; Clang and the grammar do not.)
Metadata
Metadata
Assignees
Labels
No labels