Created on 2026-03-31.00:00:00 last changed 6 days ago
Possible resolution:
Change in 13.8.1 [temp.res.general] bullet 6.6 as follows:
The program is ill-formed, no diagnostic required, if
- ...
everyno valid specializationof, ignoring static_assert-declarations that fail, can be generated for a variadic templaterequires an emptywhere a template parameter pack is non-empty, or- ...
(From submission #878.)
The phrasing in 13.8.1 [temp.res.general] bullet 6.6 is not parallel to similar phrasings in bullets 1-3:
The program is ill-formed, no diagnostic required, if
- ...
- every valid specialization of a variadic template requires an empty template parameter pack, or
- ...
For example, this bullet is vacuously true (but unintentionally so) if there is no valid specialization at all.
Also, a similar rule for empty structured binding packs is missing, although the example in 9.7 [dcl.struct.bind] paragraph 3 appears to indicate support for these. However, consider:
int f(auto x) {
auto [...y] = x;
union U : decltype(y)... {}; // unions cannot have base classes
return 0;
}
struct S {};
int z = f(S());
This might be addressed by 13.7.4 [temp.variadic] paragraph 7, though, together with the existing rule about valid specializations for the function template f.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-08-30 13:38:54 | admin | set | messages: + msg8670 |
| 2026-03-31 00:00:00 | admin | create | |