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

2025-08-11


3048. Empty destructuring expansion statements

Section: 8.7  [stmt.expand]     Status: open     Submitter: Jakub Jelinek     Date: 2025-08-09

(From submission #743.)

Consider:

struct S { };
void f() {
  S s;
  template for (auto x : s) { }
}

This destructuring expansion statement is ill-formed, because the syntactic rewrite contains

  auto&& [] = s ;

which is an ill-formed structured binding declaration.

Empty expansion statements are allowed for the other two kinds of expansion statements.

Possible resolution:

Change in 8.7 [stmt.expand] bullet 5.3 as follows: