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
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
- it is a concept-id and any of its arguments are dependent,
- it is type-dependent,
- it is the name of a non-type template parameter,
- it names a static data member that is a dependent member of the current instantiation and is not initialized in a member-declarator,
- it names a static member function that is a dependent member of the current instantiation,
or- it names a potentially-constant variable (7.7 [expr.const]) that is initialized with an expression that is value-dependent
., or- it names a structured binding whose associated variable (9.6 [dcl.struct.bind]) is value-dependent.