|
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
|
|
6897 | 6913 | A structured binding declaration introduces the \grammarterm{identifier}{s}
|
6898 | 6914 | $\tcode{v}_0$, $\tcode{v}_1$, $\tcode{v}_2, \dotsc$
|
6899 | 6915 | of the
|
6900 |
| -\grammarterm{identifier-list} as names |
| 6916 | +\grammarterm{attributed-identifier-list} as names |
6901 | 6917 | of \defn{structured binding}{s}.
|
| 6918 | +The optional \grammarterm{attribute-specifier-seq} of |
| 6919 | +an \grammarterm{attributed-identifier} |
| 6920 | +appertains to the structured binding so introduced. |
6902 | 6921 | Let \cv{} denote the \grammarterm{cv-qualifier}{s} in
|
6903 | 6922 | the \grammarterm{decl-specifier-seq} and
|
6904 | 6923 | \placeholder{S} consist of the \grammarterm{storage-class-specifier}{s} of
|
|
6937 | 6956 |
|
6938 | 6957 | \pnum
|
6939 | 6958 | If \tcode{E} is an array type with element type \tcode{T}, the number
|
6940 |
| -of elements in the \grammarterm{identifier-list} shall be equal to the |
| 6959 | +of elements in the \grammarterm{attributed-identifier-list} shall be equal to the |
6941 | 6960 | number of elements of \tcode{E}. Each $\tcode{v}_i$ is the name of an
|
6942 | 6961 | lvalue that refers to the element $i$ of the array and whose type
|
6943 | 6962 | is \tcode{T}; the referenced type is \tcode{T}.
|
|
6960 | 6979 | shall be a well-formed integral constant expression
|
6961 | 6980 | and
|
6962 | 6981 | the number of elements in
|
6963 |
| -the \grammarterm{identifier-list} shall be equal to the value of that |
| 6982 | +the \grammarterm{attributed-identifier-list} shall be equal to the value of that |
6964 | 6983 | expression.
|
6965 | 6984 | Let \tcode{i} be an index prvalue of type \tcode{std::size_t}
|
6966 | 6985 | corresponding to $\tcode{v}_i$.
|
|
7002 | 7021 | well-formed when named as \tcode{\exposidnc{e}.\placeholder{name}}
|
7003 | 7022 | in the context of the structured binding,
|
7004 | 7023 | \tcode{E} shall not have an anonymous union member, and
|
7005 |
| -the number of elements in the \grammarterm{identifier-list} shall be |
| 7024 | +the number of elements in the \grammarterm{attributed-identifier-list} shall be |
7006 | 7025 | equal to the number of non-static data members of \tcode{E}.
|
7007 | 7026 | Designating the non-static data members of \tcode{E} as
|
7008 | 7027 | $\tcode{m}_0$, $\tcode{m}_1$, $\tcode{m}_2, \dotsc$
|
|
9175 | 9194 | The attribute may be applied to the declaration of a class,
|
9176 | 9195 | \grammarterm{typedef-name},
|
9177 | 9196 | variable (including a structured binding declaration),
|
| 9197 | +structured binding, |
9178 | 9198 | non-static data member,
|
9179 | 9199 | function,
|
9180 | 9200 | enumeration, or
|
|
0 commit comments