|
67 | 67 | \keyword{using} identifier \opt{attribute-specifier-seq} \terminal{=} defining-type-id \terminal{;}
|
68 | 68 | \end{bnf}
|
69 | 69 |
|
| 70 | +\begin{bnf} |
| 71 | +\nontermdef{attributed-identifier}\br |
| 72 | + identifier \opt{attribute-specifier-seq} |
| 73 | +\end{bnf} |
| 74 | + |
| 75 | +\begin{bnf} |
| 76 | +\nontermdef{attributed-identifier-list}\br |
| 77 | + attributed-identifier\br |
| 78 | + attributed-identifier-list \terminal{,} attributed-identifier |
| 79 | +\end{bnf} |
| 80 | + |
| 81 | +\begin{bnf} |
| 82 | +\nontermdef{structured-binding-declaration}\br |
| 83 | + \opt{attribute-specifier-seq} decl-specifier-seq \opt{ref-qualifier} \terminal{[} attributed-identifier-list \terminal{]} |
| 84 | +\end{bnf} |
| 85 | + |
70 | 86 | \begin{bnf}
|
71 | 87 | \nontermdef{simple-declaration}\br
|
72 | 88 | decl-specifier-seq \opt{init-declarator-list} \terminal{;}\br
|
73 | 89 | attribute-specifier-seq decl-specifier-seq init-declarator-list \terminal{;}\br
|
74 |
| - \opt{attribute-specifier-seq} decl-specifier-seq \opt{ref-qualifier} \terminal{[} identifier-list \terminal{]} initializer \terminal{;} |
| 90 | + structured-binding-declaration initializer \terminal{;} |
75 | 91 | \end{bnf}
|
76 | 92 |
|
77 | 93 | \begin{bnf}
|
|
186 | 202 | \end{example}
|
187 | 203 |
|
188 | 204 | \pnum
|
189 |
| -A \grammarterm{simple-declaration} with an \grammarterm{identifier-list} is called |
| 205 | +A \grammarterm{simple-declaration} with a \grammarterm{structured-binding-declaration} is called |
190 | 206 | a \defn{structured binding declaration}\iref{dcl.struct.bind}.
|
191 | 207 | Each \grammarterm{decl-specifier} in the \grammarterm{decl-specifier-seq}
|
192 | 208 | shall be
|
|
6950 | 6966 | A structured binding declaration introduces the \grammarterm{identifier}{s}
|
6951 | 6967 | $\tcode{v}_0$, $\tcode{v}_1$, $\tcode{v}_2, \dotsc$
|
6952 | 6968 | of the
|
6953 |
| -\grammarterm{identifier-list} as names |
| 6969 | +\grammarterm{attributed-identifier-list} as names |
6954 | 6970 | of \defn{structured binding}{s}.
|
| 6971 | +The optional \grammarterm{attribute-specifier-seq} of |
| 6972 | +an \grammarterm{attributed-identifier} |
| 6973 | +appertains to the structured binding so introduced. |
6955 | 6974 | Let \cv{} denote the \grammarterm{cv-qualifier}{s} in
|
6956 | 6975 | the \grammarterm{decl-specifier-seq} and
|
6957 | 6976 | \placeholder{S} consist of the \grammarterm{storage-class-specifier}{s} of
|
|
6990 | 7009 |
|
6991 | 7010 | \pnum
|
6992 | 7011 | If \tcode{E} is an array type with element type \tcode{T}, the number
|
6993 |
| -of elements in the \grammarterm{identifier-list} shall be equal to the |
| 7012 | +of elements in the \grammarterm{attributed-identifier-list} shall be equal to the |
6994 | 7013 | number of elements of \tcode{E}. Each $\tcode{v}_i$ is the name of an
|
6995 | 7014 | lvalue that refers to the element $i$ of the array and whose type
|
6996 | 7015 | is \tcode{T}; the referenced type is \tcode{T}.
|
|
7013 | 7032 | shall be a well-formed integral constant expression
|
7014 | 7033 | and
|
7015 | 7034 | the number of elements in
|
7016 |
| -the \grammarterm{identifier-list} shall be equal to the value of that |
| 7035 | +the \grammarterm{attributed-identifier-list} shall be equal to the value of that |
7017 | 7036 | expression.
|
7018 | 7037 | Let \tcode{i} be an index prvalue of type \tcode{std::size_t}
|
7019 | 7038 | corresponding to $\tcode{v}_i$.
|
|
7055 | 7074 | well-formed when named as \tcode{\exposidnc{e}.\placeholder{name}}
|
7056 | 7075 | in the context of the structured binding,
|
7057 | 7076 | \tcode{E} shall not have an anonymous union member, and
|
7058 |
| -the number of elements in the \grammarterm{identifier-list} shall be |
| 7077 | +the number of elements in the \grammarterm{attributed-identifier-list} shall be |
7059 | 7078 | equal to the number of non-static data members of \tcode{E}.
|
7060 | 7079 | Designating the non-static data members of \tcode{E} as
|
7061 | 7080 | $\tcode{m}_0$, $\tcode{m}_1$, $\tcode{m}_2, \dotsc$
|
|
9228 | 9247 | The attribute may be applied to the declaration of a class,
|
9229 | 9248 | \grammarterm{typedef-name},
|
9230 | 9249 | variable (including a structured binding declaration),
|
| 9250 | +structured binding, |
9231 | 9251 | non-static data member,
|
9232 | 9252 | function,
|
9233 | 9253 | enumeration, or
|
|
0 commit comments