Title
Implicit deduction guides omit properties from the parameter-declaration-clause of a constructor
Status
drwp
Section
12.2.2.9 [over.match.class.deduct]
Submitter
Richard Smith

Created on 2017-02-13.00:00:00 last changed 4 months ago

Messages

Date: 2023-04-28.19:41:23

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 those parameter-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 parameters template-head, if any, and function parameters parameter-declaration-clause are those of the deduction-guide.
    • The return type is the simple-template-id of the deduction-guide.
Date: 2024-03-15.00:00:00

[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.

History
Date User Action Args
2024-07-20 13:52:34adminsetstatus: dr -> drwp
2024-04-05 21:43:46adminsetstatus: ready -> dr
2024-02-04 20:19:57adminsetstatus: open -> ready
2023-04-08 20:02:50adminsetmessages: + msg7246
2017-02-13 00:00:00admincreate