Created on 2015-01-19.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2023-02-06):
Change in 13.9.2 [temp.inst] paragraph 12 as follows:
If a templated functiontemplatef is called in a way that requires a default argument to be used, the dependent names are looked up, the semantics constraints are checked, and the instantiation of any template used in the default argument is done as if the default argument had been an initializer used in a function template specialization with the same scope, the same template parameters and the same access as that of the function template f used at that point, except that the scope in which a closure type is declared (7.5.6.2 [expr.prim.lambda.closure]) --- and therefore its associated namespaces --- remain as determined from the context of the definition for the default argument. This analysis is called default argument instantiation. The instantiated default argument is then used as the argument of f.
[Accepted as a DR at the February, 2023 meeting.]
Default argument instantiation is described in 13.9.2 [temp.inst] paragraph 12, and although instantiation of default arguments for member functions of class templates is mentioned elsewhere a number of times, this paragraph only describes default argument instantiation for function templates.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: dr -> open |
2023-02-18 18:43:04 | admin | set | status: ready -> dr |
2023-02-10 23:01:52 | admin | set | messages: + msg7190 |
2023-02-10 23:01:52 | admin | set | status: tentatively ready -> ready |
2023-02-07 06:06:05 | admin | set | status: review -> tentatively ready |
2022-11-20 07:54:16 | admin | set | status: open -> review |
2022-02-18 07:47:23 | admin | set | status: drafting -> open |
2015-01-19 00:00:00 | admin | create |