|
45 | 45 |
|
46 | 46 | \begin{bnf}
|
47 | 47 | \nontermdef{nodeclspec-function-declaration}\br
|
48 |
| - attribute-specifier-seq\opt declarator \terminal{;} |
| 48 | + attribute-specifier-seq\opt{} declarator \terminal{;} |
49 | 49 | \end{bnf}
|
50 | 50 |
|
51 | 51 | \begin{bnf}
|
|
57 | 57 | \nontermdef{simple-declaration}\br
|
58 | 58 | decl-specifier-seq init-declarator-list\opt{} \terminal{;}\br
|
59 | 59 | attribute-specifier-seq decl-specifier-seq init-declarator-list \terminal{;}\br
|
60 |
| - attribute-specifier-seq\opt decl-specifier-seq ref-qualifier\opt{} \terminal{[} identifier-list \terminal{]} initializer \terminal{;} |
| 60 | + attribute-specifier-seq\opt{} decl-specifier-seq ref-qualifier\opt{} \terminal{[} identifier-list \terminal{]} initializer \terminal{;} |
61 | 61 | \end{bnf}
|
62 | 62 |
|
63 | 63 | \begin{bnf}
|
|
93 | 93 | \grammarterm{nodeclspec-function-declaration} of the form
|
94 | 94 |
|
95 | 95 | \begin{ncsimplebnf}
|
96 |
| -attribute-specifier-seq\opt decl-specifier-seq\opt init-declarator-list\opt{} \terminal{;} |
| 96 | +attribute-specifier-seq\opt{} decl-specifier-seq\opt{} init-declarator-list\opt{} \terminal{;} |
97 | 97 | \end{ncsimplebnf}
|
98 | 98 |
|
99 | 99 | is divided into three parts.
|
|
258 | 258 |
|
259 | 259 | \begin{bnf}
|
260 | 260 | \nontermdef{decl-specifier-seq}\br
|
261 |
| - decl-specifier attribute-specifier-seq\opt\br |
| 261 | + decl-specifier attribute-specifier-seq\opt{}\br |
262 | 262 | decl-specifier decl-specifier-seq
|
263 | 263 | \end{bnf}
|
264 | 264 |
|
|
1043 | 1043 |
|
1044 | 1044 | \begin{bnf}
|
1045 | 1045 | \nontermdef{type-specifier-seq}\br
|
1046 |
| - type-specifier attribute-specifier-seq\opt\br |
| 1046 | + type-specifier attribute-specifier-seq\opt{}\br |
1047 | 1047 | type-specifier type-specifier-seq
|
1048 | 1048 | \end{bnf}
|
1049 | 1049 |
|
|
1056 | 1056 |
|
1057 | 1057 | \begin{bnf}
|
1058 | 1058 | \nontermdef{defining-type-specifier-seq}\br
|
1059 |
| - defining-type-specifier attribute-specifier-seq\opt\br |
| 1059 | + defining-type-specifier attribute-specifier-seq\opt{}\br |
1060 | 1060 | defining-type-specifier defining-type-specifier-seq
|
1061 | 1061 | \end{bnf}
|
1062 | 1062 |
|
|
1233 | 1233 |
|
1234 | 1234 | \begin{bnf}
|
1235 | 1235 | \nontermdef{simple-type-specifier}\br
|
1236 |
| - nested-name-specifier\opt type-name\br |
| 1236 | + nested-name-specifier\opt{} type-name\br |
1237 | 1237 | nested-name-specifier \terminal{template} simple-template-id\br
|
1238 |
| - nested-name-specifier\opt template-name\br |
| 1238 | + nested-name-specifier\opt{} template-name\br |
1239 | 1239 | \terminal{char}\br
|
1240 | 1240 | \terminal{char16_t}\br
|
1241 | 1241 | \terminal{char32_t}\br
|
|
1469 | 1469 |
|
1470 | 1470 | \begin{bnf}
|
1471 | 1471 | \nontermdef{elaborated-type-specifier}\br
|
1472 |
| - class-key attribute-specifier-seq\opt nested-name-specifier\opt identifier\br |
| 1472 | + class-key attribute-specifier-seq\opt{} nested-name-specifier\opt{} identifier\br |
1473 | 1473 | class-key simple-template-id\br
|
1474 |
| - class-key nested-name-specifier \terminal{template}\opt simple-template-id\br |
1475 |
| - \terminal{enum} nested-name-specifier\opt identifier |
| 1474 | + class-key nested-name-specifier \terminal{template}\opt{} simple-template-id\br |
| 1475 | + \terminal{enum} nested-name-specifier\opt{} identifier |
1476 | 1476 | \end{bnf}
|
1477 | 1477 |
|
1478 | 1478 | \pnum
|
|
1487 | 1487 | forms:
|
1488 | 1488 |
|
1489 | 1489 | \begin{ncsimplebnf}
|
1490 |
| -class-key attribute-specifier-seq\opt identifier \terminal{;}\br |
1491 |
| -\terminal{friend} class-key \terminal{::\opt} identifier \terminal{;}\br |
1492 |
| -\terminal{friend} class-key \terminal{::\opt} simple-template-id \terminal{;}\br |
| 1490 | +class-key attribute-specifier-seq\opt{} identifier \terminal{;}\br |
| 1491 | +\terminal{friend} class-key \terminal{::\opt{}} identifier \terminal{;}\br |
| 1492 | +\terminal{friend} class-key \terminal{::\opt{}} simple-template-id \terminal{;}\br |
1493 | 1493 | \terminal{friend} class-key nested-name-specifier identifier \terminal{;}\br
|
1494 |
| -\terminal{friend} class-key nested-name-specifier \terminal{template\opt} simple-template-id \terminal{;} |
| 1494 | +\terminal{friend} class-key nested-name-specifier \terminal{template\opt{}} simple-template-id \terminal{;} |
1495 | 1495 | \end{ncsimplebnf}
|
1496 | 1496 |
|
1497 | 1497 | In the first case, the \grammarterm{attribute-specifier-seq}, if any, appertains
|
|
1928 | 1928 |
|
1929 | 1929 | \begin{bnf}
|
1930 | 1930 | \nontermdef{enum-head}\br
|
1931 |
| - enum-key attribute-specifier-seq\opt enum-head-name\opt enum-base\opt |
| 1931 | + enum-key attribute-specifier-seq\opt{} enum-head-name\opt{} enum-base\opt{} |
1932 | 1932 | \end{bnf}
|
1933 | 1933 |
|
1934 | 1934 | \begin{bnf}
|
1935 | 1935 | \nontermdef{enum-head-name}\br
|
1936 |
| - nested-name-specifier\opt identifier |
| 1936 | + nested-name-specifier\opt{} identifier |
1937 | 1937 | \end{bnf}
|
1938 | 1938 |
|
1939 | 1939 | \begin{bnf}
|
1940 | 1940 | \nontermdef{opaque-enum-declaration}\br
|
1941 |
| - enum-key attribute-specifier-seq\opt nested-name-specifier\opt identifier enum-base\opt{} \terminal{;} |
| 1941 | + enum-key attribute-specifier-seq\opt{} nested-name-specifier\opt{} identifier enum-base\opt{} \terminal{;} |
1942 | 1942 | \end{bnf}
|
1943 | 1943 |
|
1944 | 1944 | \begin{bnf}
|
|
1967 | 1967 |
|
1968 | 1968 | \begin{bnf}
|
1969 | 1969 | \nontermdef{enumerator}\br
|
1970 |
| - identifier attribute-specifier-seq\opt |
| 1970 | + identifier attribute-specifier-seq\opt{} |
1971 | 1971 | \end{bnf}
|
1972 | 1972 |
|
1973 | 1973 | The optional \grammarterm{attribute-specifier-seq} in the \grammarterm{enum-head} and
|
1974 | 1974 | the \grammarterm{opaque-enum-declaration} appertains to the enumeration; the attributes
|
1975 | 1975 | in that \grammarterm{attribute-specifier-seq} are thereafter considered attributes of the
|
1976 | 1976 | enumeration whenever it is named.
|
1977 | 1977 | A \tcode{:} following
|
1978 |
| -``\tcode{enum} \grammarterm{nested-name-specifier\opt} \grammarterm{identifier}'' |
| 1978 | +``\tcode{enum} \grammarterm{nested-name-specifier\opt{}} \grammarterm{identifier}'' |
1979 | 1979 | within the \grammarterm{decl-specifier-seq} of a \grammarterm{member-declaration}
|
1980 | 1980 | is parsed as part of an \grammarterm{enum-base}.
|
1981 | 1981 | \begin{note} This resolves a potential ambiguity between the declaration of an enumeration
|
|
2276 | 2276 |
|
2277 | 2277 | \begin{bnf}
|
2278 | 2278 | \nontermdef{named-namespace-definition}\br
|
2279 |
| - \terminal{inline\opt} \terminal{namespace} attribute-specifier-seq\opt identifier \terminal{\{} namespace-body \terminal{\}} |
| 2279 | + \terminal{inline\opt{}} \terminal{namespace} attribute-specifier-seq\opt{} identifier \terminal{\{} namespace-body \terminal{\}} |
2280 | 2280 | \end{bnf}
|
2281 | 2281 |
|
2282 | 2282 | \begin{bnf}
|
2283 | 2283 | \nontermdef{unnamed-namespace-definition}\br
|
2284 |
| - \terminal{inline\opt} \terminal{namespace} attribute-specifier-seq\opt{} \terminal{\{} namespace-body \terminal{\}} |
| 2284 | + \terminal{inline\opt{}} \terminal{namespace} attribute-specifier-seq\opt{} \terminal{\{} namespace-body \terminal{\}} |
2285 | 2285 | \end{bnf}
|
2286 | 2286 |
|
2287 | 2287 | \begin{bnf}
|
|
2297 | 2297 |
|
2298 | 2298 | \begin{bnf}
|
2299 | 2299 | \nontermdef{namespace-body}\br
|
2300 |
| - declaration-seq\opt |
| 2300 | + declaration-seq\opt{} |
2301 | 2301 | \end{bnf}
|
2302 | 2302 |
|
2303 | 2303 | \pnum
|
|
2479 | 2479 | whose \grammarterm{class-head-name} (Clause \ref{class}) or
|
2480 | 2480 | \grammarterm{enum-head-name}~(\ref{dcl.enum}) is an \grammarterm{identifier}, or
|
2481 | 2481 | whose \grammarterm{elaborated-type-specifier} is of the form \grammarterm{class-key}
|
2482 |
| -\grammarterm{attribute-specifier-seq\opt} \grammarterm{identifier}~(\ref{dcl.type.elab}), or |
| 2482 | +\grammarterm{attribute-specifier-seq\opt{}} \grammarterm{identifier}~(\ref{dcl.type.elab}), or |
2483 | 2483 | that is an \grammarterm{opaque-enum-declaration},
|
2484 | 2484 | declares (or redeclares) its \grammarterm{unqualified-id} or
|
2485 | 2485 | \grammarterm{identifier} as a member of \tcode{N}.
|
|
2608 | 2608 |
|
2609 | 2609 | \begin{bnf}
|
2610 | 2610 | \nontermdef{qualified-namespace-specifier}\br
|
2611 |
| - nested-name-specifier\opt namespace-name |
| 2611 | + nested-name-specifier\opt{} namespace-name |
2612 | 2612 | \end{bnf}
|
2613 | 2613 |
|
2614 | 2614 | \pnum
|
|
2648 | 2648 |
|
2649 | 2649 | \begin{bnf}
|
2650 | 2650 | \nontermdef{using-declarator-list}\br
|
2651 |
| - using-declarator \terminal{...}\opt\br |
2652 |
| - using-declarator-list \terminal{,} using-declarator \terminal{...}\opt |
| 2651 | + using-declarator \terminal{...}\opt{}\br |
| 2652 | + using-declarator-list \terminal{,} using-declarator \terminal{...}\opt{} |
2653 | 2653 | \end{bnf}
|
2654 | 2654 |
|
2655 | 2655 | \begin{bnf}
|
2656 | 2656 | \nontermdef{using-declarator}\br
|
2657 |
| - \terminal{typename\opt} nested-name-specifier unqualified-id |
| 2657 | + \terminal{typename\opt{}} nested-name-specifier unqualified-id |
2658 | 2658 | \end{bnf}
|
2659 | 2659 |
|
2660 | 2660 | \pnum
|
|
3123 | 3123 |
|
3124 | 3124 | \begin{bnf}
|
3125 | 3125 | \nontermdef{using-directive}\br
|
3126 |
| - attribute-specifier-seq\opt{} \terminal{using namespace} nested-name-specifier\opt namespace-name \terminal{;} |
| 3126 | + attribute-specifier-seq\opt{} \terminal{using namespace} nested-name-specifier\opt{} namespace-name \terminal{;} |
3127 | 3127 | \end{bnf}
|
3128 | 3128 |
|
3129 | 3129 | \pnum
|
|
3596 | 3596 |
|
3597 | 3597 | \begin{bnf}
|
3598 | 3598 | \nontermdef{attribute-specifier-seq}\br
|
3599 |
| - attribute-specifier-seq\opt attribute-specifier |
| 3599 | + attribute-specifier-seq\opt{} attribute-specifier |
3600 | 3600 | \end{bnf}
|
3601 | 3601 |
|
3602 | 3602 | \begin{bnf}
|
|
3618 | 3618 |
|
3619 | 3619 | \begin{bnf}
|
3620 | 3620 | \nontermdef{attribute-list}\br
|
3621 |
| - attribute\opt\br |
3622 |
| - attribute-list \terminal{,} attribute\opt\br |
| 3621 | + attribute\opt{}\br |
| 3622 | + attribute-list \terminal{,} attribute\opt{}\br |
3623 | 3623 | attribute \terminal{...}\br
|
3624 | 3624 | attribute-list \terminal{,} attribute \terminal{...}
|
3625 | 3625 | \end{bnf}
|
3626 | 3626 |
|
3627 | 3627 | \begin{bnf}
|
3628 | 3628 | \nontermdef{attribute}\br
|
3629 |
| - attribute-token attribute-argument-clause\opt |
| 3629 | + attribute-token attribute-argument-clause\opt{} |
3630 | 3630 | \end{bnf}
|
3631 | 3631 |
|
3632 | 3632 | \begin{bnf}
|
|
0 commit comments