Created on 2021-11-27.00:00:00 last changed 16 months ago
Proposed resolution (approved by CWG 2022-09-09):
Change in 13.10.3.1 [temp.deduct.general] paragraph 7 as follows:
The deduction substitution loci are
The substitution occurs in all types and expressions that are used in the
- the function type outside of the noexcept-specifier,
- the explicit-specifier, and
- the template parameter declarations.
function type and in template parameter declarationsdeduction substitution loci. ...
Change in 13.10.3.1 [temp.deduct.general] paragraph 8 as follows:
...Only invalidInvalid types and expressions can result in a deduction failure only in the immediate context of thefunction type, its template parameter types, and its explicit-specifierdeduction substitution locican result in a deduction failure.
[Accepted as a DR at the November, 2022 meeting.]
Subclause 13.10.3.1 [temp.deduct.general] paragraph 7 specifies:
The substitution occurs in all types and expressions that are used in the function type and in template parameter declarations. The expressions include not only constant expressions such as those that appear in array bounds or as nontype template arguments but also general expressions (i.e., non-constant expressions) inside sizeof, decltype, and other contexts that allow non-constant expressions. The substitution proceeds in lexical order and stops when a condition that causes deduction to fail is encountered. If substitution into different declarations of the same function template would cause template instantiations to occur in a different order or not at all, the program is ill-formed; no diagnostic required.
[Note 4: The equivalent substitution in exception specifications is done only when the noexcept-specifier is instantiated, at which point a program is ill-formed if the substitution results in an invalid type or expression. —end note]
The note says that substitution into the noexcept-specifier occurs late, but the normative text does not support that, because the exception specification is part of the function type.
Subclause 13.10.3.1 [temp.deduct.general] paragraph 8 specifies:
Only invalid types and expressions in the immediate context of the function type, its template parameter types, and its explicit-specifier can result in a deduction failure.
However, paragraph 7 does not mention the explicit-specifier when describing the substitution.
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: drwp -> open |
2023-02-18 18:43:04 | admin | set | status: dr -> drwp |
2022-11-25 05:14:04 | admin | set | status: ready -> dr |
2022-09-09 20:20:01 | admin | set | messages: + msg6931 |
2022-09-09 20:20:01 | admin | set | status: open -> ready |
2021-11-27 00:00:00 | admin | create |