This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 119a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-12-20
[Accepted at the February, 2022 meeting.]
According to 9.7 [dcl.struct.bind] paragraph 1,
A structured binding declaration introduces theidentifiersv0,v1,v2, ... of theidentifier-list asnames ofstructured bindings. Letcv denotethecv-qualifiers in thedecl-specifier-seqandS consist of thestorage-class-specifiersof thedecl-specifier-seq (if any). Acv thatincludes volatile is deprecated; seeD.4 [depr.volatile.type]. First, a variable with a uniquenamee is introduced. Iftheassignment-expression in the initializer hasarray typeA and noref-qualifier ispresent,e is defined by
attribute-specifier-seqopt S cvAe;
and each element is copy-initialized or direct-initializedfrom the corresponding element oftheassignment-expression as specified by the form ofthe initializer.
This means that in an example like
const int arr[1]{}; auto [i] = arr;i is a reference toconst int. Presumablythe fact that the array is copied should drop the array'scv-qualification.
Proposed resolution (December, 2021):
Change 9.7 [dcl.struct.bind] paragraph 1 as follows:
If theassignment-expression in the initializerhas array typecv1A andnoref-qualifier is present,e is definedby...