This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-10-12


3096. Value-dependence of size of structured binding pack with non-dependent initializer

Section: 13.8.3.4  [temp.dep.constexpr]     Status: open     Submitter: AT     Date: 2025-10-01

N5028 comment AT 4-099

The special case for a structured binding pack introduces an unnecessary inconsistency. A structured binding pack with a non-dependent initializer should either always be instantiated early or never, regardless of the expression it is used in. The more comprehensive rule to always instantiate early was removed after R7 of the paper (P1061R7 Structured Bindings can introduce a Pack), but the special case for "sizeof ..." remained.

Suggested resolution:

Change in 13.8.3.4 [temp.dep.constexpr] paragraph 4 as follows:

Expressions of the following form are value-dependent:
  sizeof ... ( identifier )
  fold-expression
unless the identifier is a structured binding pack whose initializer is not dependent.