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

2025-11-07


2706. Repeated structured binding declarations

Section: 6.7  [basic.link]     Status: open     Submitter: Jim X     Date: 2023-02-13

Consider:

 struct A { int a; }; struct B { int b; }; auto&& [x] = A{}; //#1 auto&& [x] = B{}; //#2 

A rule is missing to make such repeated structured binding declarations ill-formed.

Suggested resolution:

Change in 6.7 [basic.link] paragraph 11 as follows:

For any two declarations of an entity E: