Title
Value-dependence of size of structured binding pack with non-dependent initializer
Status
open
Section
13.8.3.4 [temp.dep.constexpr]
Submitter
AT

Created on 2025-10-01.00:00:00 last changed yesterday

Messages

Date: 2025-10-12.14:43:59

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.
Date: 2025-10-01.00:00:00
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.

History
Date User Action Args
2025-10-12 14:43:59adminsetmessages: + msg8162
2025-10-01 00:00:00admincreate