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

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

Messages

Date: 2026-09-11.18:00:31

Proposed resolution (approved by CWG 2026-09-11):

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

The program is ill-formed, no diagnostic required, if
  • ...
  • every there exists a template parameter pack P of a variadic template TT such that no valid specialization of, ignoring static_assert-declarations that fail, can be generated for TT a variadic template requires an empty template parameter pack when P 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-09-11 18:00:31adminsetstatus: review -> tentatively ready
2026-09-11 16:51:37adminsetstatus: open -> review
2026-08-30 13:38:54adminsetmessages: + msg8670
2026-03-31 00:00:00admincreate