Title
IFNDR for always-empty packs
Status
open
Section
13.8.1 [temp.res.general]
Submitter
Jay Ghiron

Created on 2026-03-31.00:00:00 last changed 6 days ago

Messages

Date: 2026-08-31.11:59:38

Possible resolution:

Change in 13.8.1 [temp.res.general] bullet 6.6 as follows:

The program is ill-formed, no diagnostic required, if
  • ...
  • every no valid specialization of, ignoring static_assert-declarations that fail, can be generated for a variadic template requires an empty where a template parameter pack is non-empty, or
  • ...
Date: 2026-08-31.11:59:38

(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:54adminsetmessages: + msg8670
2026-03-31 00:00:00admincreate