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

2025-01-14


2984. Value-dependent structured bindings

Section: 13.8.3.4  [temp.dep.constexpr]     Status: open     Submitter: Michael Park     Date: 2025-01-14

Consider:

  struct S { int x; };

  template <S s>
  void f() {
   constexpr auto [x] = s;
   constexpr bool b = (x == 0); // x ought to be value-dependent
  }

The rules in 13.8.3.4 [temp.dep.constexpr] do not seem to cover the case of structured bindings.

Possible resolution:

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

An id-expression is value-dependent if