Created on 2014-12-07.00:00:00 last changed 1 month ago
Proposed resolution (approved by CWG 2023-11-08):
Change in 13.10.3.1 [temp.deduct.general] paragraph 7 as follows:
The deduction substitution loci areThe substitution occurs in all types and expressions that are used in the deduction substitution loci. ...
- the function type outside of the noexcept-specifier,
- the explicit-specifier,
and- the template parameter declarations
., and- the template argument list of a partial specialization (13.7.6.1 [temp.spec.partial.general]).
Additional notes (January, 2023)
The section on SFINAE (13.10.3.1 [temp.deduct.general] paragraph 8) is not specific to function templates, and 13.7.6.2 [temp.spec.partial.match] paragraph 2 hands off the "matching" determination for partial specializations to 13.10.3 [temp.deduct] in general. However, the definition of deduction substitution loci in 13.10.3.1 [temp.deduct.general] paragraph 7 does not account for the template argument list of a partial specialization.
[Accepted as a DR at the November, 2023 meeting.]
Presumably something like the following should be well-formed, where a deduction failure in a partial specialization is handled as a SFINAE case as it is with function templates and not a hard error:
template <class T, class U> struct X {
typedef char member;
};
template<class T> struct X<T,
typename enable_if<(sizeof(T)>sizeof(
float)), float>::type>
{
typedef long long member;
};
int main() {
cout << sizeof(X<double, float>::member);
}
However, this does not appear to be described anywhere in the Standard.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-09-12 22:42:26 | admin | set | status: open -> cd7 |
| 2025-09-12 22:42:26 | admin | set | status: drwp -> open |
| 2024-04-05 21:43:46 | admin | set | status: dr -> drwp |
| 2023-12-19 10:15:28 | admin | set | status: ready -> dr |
| 2023-11-08 22:44:02 | admin | set | messages: + msg7501 |
| 2023-11-08 22:44:02 | admin | set | status: review -> ready |
| 2023-01-28 10:22:40 | admin | set | messages: + msg7156 |
| 2023-01-28 10:22:40 | admin | set | status: open -> review |
| 2014-12-07 00:00:00 | admin | create | |