1. This revision
This revision contains only wording for the changes approved by EWG:
-
By value capture of structured bindings
-
static and thread_local for structured binding declarations
Read a previous revision to know more.
2. Proposed wording
Change [expr.prim.lambda.capture]p8 (7.5.5.2) as follows:
If a lambda-expression explicitly captures an entity that is not odr-usableor captures a structured binding (explicitly or implicitly), the program is ill-formed.
Change [expr.prim.lambda.capture]p12 (7.5.5.2) as follows:
A bit-field , a structured binding, or a member of an anonymous union shall not be captured by reference.
Change [dcl.struct.bind]p1 (9.5) as follows:
If the assignment-expression in the initializer has array typeand no ref-qualifier is present,
A
e has type cvis defined by
A attribute-specifier-seqopt decl-specifier-seq cv
where the decl-specifier-seq does not include the type-specifiere ;
A and each element is copy-initialized or direct-initialized from the corresponding element of the assignment-expression as specified by the form of the initializer.
auto
Add a sentence to [dcl.struct.bind]p1 (9.5) as follows:
If either the storage-class-specifieror
static appears in the decl-specifier-seq of the structured binding declaration, then the declaration shall not be defined at namespace scope.
thread_local
Change [dcl.dcl]p8 (10) as follows:
The decl-specifier-seq shall contain only the storage-class-specifiersand
static , the type-specifier
thread_local and cv-qualifiers.
auto
Change [dcl.stc]p3 (10.1.1) as follows:
It shall be applied only to the names of variables of namespace or block scope , to structured binding declarations ([dcl.struct.bind]) and to the names of static data members.
Change [dcl.stc]p4 (10.1.1) as follows:
The static
specifier can be applied only to names of variables and functions
, to structured binding declarations ([dcl.struct.bind]),
and to anonymous unions.