|
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
|
|
6968 | 6984 | A structured binding declaration introduces the \grammarterm{identifier}{s}
|
6969 | 6985 | $\tcode{v}_0$, $\tcode{v}_1$, $\tcode{v}_2, \dotsc$
|
6970 | 6986 | of the
|
6971 |
| -\grammarterm{identifier-list} as names |
| 6987 | +\grammarterm{attributed-identifier-list} as names |
6972 | 6988 | of \defn{structured binding}{s}.
|
| 6989 | +The optional \grammarterm{attribute-specifier-seq} of |
| 6990 | +an \grammarterm{attributed-identifier} |
| 6991 | +appertains to the structured binding so introduced. |
6973 | 6992 | Let \cv{} denote the \grammarterm{cv-qualifier}{s} in
|
6974 | 6993 | the \grammarterm{decl-specifier-seq} and
|
6975 | 6994 | \placeholder{S} consist of the \grammarterm{storage-class-specifier}{s} of
|
|
7008 | 7027 |
|
7009 | 7028 | \pnum
|
7010 | 7029 | If \tcode{E} is an array type with element type \tcode{T}, the number
|
7011 |
| -of elements in the \grammarterm{identifier-list} shall be equal to the |
| 7030 | +of elements in the \grammarterm{attributed-identifier-list} shall be equal to the |
7012 | 7031 | number of elements of \tcode{E}. Each $\tcode{v}_i$ is the name of an
|
7013 | 7032 | lvalue that refers to the element $i$ of the array and whose type
|
7014 | 7033 | is \tcode{T}; the referenced type is \tcode{T}.
|
|
7031 | 7050 | shall be a well-formed integral constant expression
|
7032 | 7051 | and
|
7033 | 7052 | the number of elements in
|
7034 |
| -the \grammarterm{identifier-list} shall be equal to the value of that |
| 7053 | +the \grammarterm{attributed-identifier-list} shall be equal to the value of that |
7035 | 7054 | expression.
|
7036 | 7055 | Let \tcode{i} be an index prvalue of type \tcode{std::size_t}
|
7037 | 7056 | corresponding to $\tcode{v}_i$.
|
|
7073 | 7092 | well-formed when named as \tcode{\exposidnc{e}.\placeholder{name}}
|
7074 | 7093 | in the context of the structured binding,
|
7075 | 7094 | \tcode{E} shall not have an anonymous union member, and
|
7076 |
| -the number of elements in the \grammarterm{identifier-list} shall be |
| 7095 | +the number of elements in the \grammarterm{attributed-identifier-list} shall be |
7077 | 7096 | equal to the number of non-static data members of \tcode{E}.
|
7078 | 7097 | Designating the non-static data members of \tcode{E} as
|
7079 | 7098 | $\tcode{m}_0$, $\tcode{m}_1$, $\tcode{m}_2, \dotsc$
|
|
9246 | 9265 | The attribute may be applied to the declaration of a class,
|
9247 | 9266 | \grammarterm{typedef-name},
|
9248 | 9267 | variable (including a structured binding declaration),
|
| 9268 | +structured binding, |
9249 | 9269 | non-static data member,
|
9250 | 9270 | function,
|
9251 | 9271 | enumeration, or
|
|
0 commit comments