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.

2024-12-19


2289. Uniqueness of structured binding names

Section: _N4868_.6.4.1  [basic.scope.declarative]     Status: CD5     Submitter: Richard Smith     Date: 2016-07-20

[Accepted as a DR at the February, 2019 meeting.]

The current wording is not clear regarding examples like the following:

  struct A { int x; } a;
  struct B {} b; template<int> int &get(const B&);
  struct C {}; int c[1];
  auto [A] = a; // ok? 
  auto [B] = b; // ok? 
  auto [C] = c; // ok? 

Notes from the April, 2017 teleconference:

Structured bindings have no C compatibility implications, so the tag/nontag treatment need not apply.

Proposed resolution (February, 2019):

Change _N4868_.6.4.1 [basic.scope.declarative] paragraph 4 as follows:

Given a set of declarations in a single declarative region, each of which specifies the same unqualified name,