|
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 |
|
|
1042 | 1042 |
|
1043 | 1043 | \begin{bnf}
|
1044 | 1044 | \nontermdef{type-specifier-seq}\br
|
1045 |
| - type-specifier attribute-specifier-seq\opt\br |
| 1045 | + type-specifier attribute-specifier-seq\opt{}\br |
1046 | 1046 | type-specifier type-specifier-seq
|
1047 | 1047 | \end{bnf}
|
1048 | 1048 |
|
|
1055 | 1055 |
|
1056 | 1056 | \begin{bnf}
|
1057 | 1057 | \nontermdef{defining-type-specifier-seq}\br
|
1058 |
| - defining-type-specifier attribute-specifier-seq\opt\br |
| 1058 | + defining-type-specifier attribute-specifier-seq\opt{}\br |
1059 | 1059 | defining-type-specifier defining-type-specifier-seq
|
1060 | 1060 | \end{bnf}
|
1061 | 1061 |
|
|
1232 | 1232 |
|
1233 | 1233 | \begin{bnf}
|
1234 | 1234 | \nontermdef{simple-type-specifier}\br
|
1235 |
| - nested-name-specifier\opt type-name\br |
| 1235 | + nested-name-specifier\opt{} type-name\br |
1236 | 1236 | nested-name-specifier \terminal{template} simple-template-id\br
|
1237 |
| - nested-name-specifier\opt template-name\br |
| 1237 | + nested-name-specifier\opt{} template-name\br |
1238 | 1238 | \terminal{char}\br
|
1239 | 1239 | \terminal{char16_t}\br
|
1240 | 1240 | \terminal{char32_t}\br
|
|
1468 | 1468 |
|
1469 | 1469 | \begin{bnf}
|
1470 | 1470 | \nontermdef{elaborated-type-specifier}\br
|
1471 |
| - class-key attribute-specifier-seq\opt nested-name-specifier\opt identifier\br |
| 1471 | + class-key attribute-specifier-seq\opt{} nested-name-specifier\opt{} identifier\br |
1472 | 1472 | class-key simple-template-id\br
|
1473 |
| - class-key nested-name-specifier \terminal{template}\opt simple-template-id\br |
1474 |
| - \terminal{enum} nested-name-specifier\opt identifier |
| 1473 | + class-key nested-name-specifier \terminal{template}\opt{} simple-template-id\br |
| 1474 | + \terminal{enum} nested-name-specifier\opt{} identifier |
1475 | 1475 | \end{bnf}
|
1476 | 1476 |
|
1477 | 1477 | \pnum
|
|
1486 | 1486 | forms:
|
1487 | 1487 |
|
1488 | 1488 | \begin{ncsimplebnf}
|
1489 |
| -class-key attribute-specifier-seq\opt identifier \terminal{;}\br |
1490 |
| -\terminal{friend} class-key \terminal{::\opt} identifier \terminal{;}\br |
1491 |
| -\terminal{friend} class-key \terminal{::\opt} simple-template-id \terminal{;}\br |
| 1489 | +class-key attribute-specifier-seq\opt{} identifier \terminal{;}\br |
| 1490 | +\terminal{friend} class-key \terminal{::\opt{}} identifier \terminal{;}\br |
| 1491 | +\terminal{friend} class-key \terminal{::\opt{}} simple-template-id \terminal{;}\br |
1492 | 1492 | \terminal{friend} class-key nested-name-specifier identifier \terminal{;}\br
|
1493 |
| -\terminal{friend} class-key nested-name-specifier \terminal{template\opt} simple-template-id \terminal{;} |
| 1493 | +\terminal{friend} class-key nested-name-specifier \terminal{template\opt{}} simple-template-id \terminal{;} |
1494 | 1494 | \end{ncsimplebnf}
|
1495 | 1495 |
|
1496 | 1496 | In the first case, the \grammarterm{attribute-specifier-seq}, if any, appertains
|
|
1927 | 1927 |
|
1928 | 1928 | \begin{bnf}
|
1929 | 1929 | \nontermdef{enum-head}\br
|
1930 |
| - enum-key attribute-specifier-seq\opt enum-head-name\opt enum-base\opt |
| 1930 | + enum-key attribute-specifier-seq\opt{} enum-head-name\opt{} enum-base\opt{} |
1931 | 1931 | \end{bnf}
|
1932 | 1932 |
|
1933 | 1933 | \begin{bnf}
|
1934 | 1934 | \nontermdef{enum-head-name}\br
|
1935 |
| - nested-name-specifier\opt identifier |
| 1935 | + nested-name-specifier\opt{} identifier |
1936 | 1936 | \end{bnf}
|
1937 | 1937 |
|
1938 | 1938 | \begin{bnf}
|
1939 | 1939 | \nontermdef{opaque-enum-declaration}\br
|
1940 |
| - enum-key attribute-specifier-seq\opt nested-name-specifier\opt identifier enum-base\opt{} \terminal{;} |
| 1940 | + enum-key attribute-specifier-seq\opt{} nested-name-specifier\opt{} identifier enum-base\opt{} \terminal{;} |
1941 | 1941 | \end{bnf}
|
1942 | 1942 |
|
1943 | 1943 | \begin{bnf}
|
|
1966 | 1966 |
|
1967 | 1967 | \begin{bnf}
|
1968 | 1968 | \nontermdef{enumerator}\br
|
1969 |
| - identifier attribute-specifier-seq\opt |
| 1969 | + identifier attribute-specifier-seq\opt{} |
1970 | 1970 | \end{bnf}
|
1971 | 1971 |
|
1972 | 1972 | The optional \grammarterm{attribute-specifier-seq} in the \grammarterm{enum-head} and
|
1973 | 1973 | the \grammarterm{opaque-enum-declaration} appertains to the enumeration; the attributes
|
1974 | 1974 | in that \grammarterm{attribute-specifier-seq} are thereafter considered attributes of the
|
1975 | 1975 | enumeration whenever it is named.
|
1976 | 1976 | A \tcode{:} following
|
1977 |
| -``\tcode{enum} \grammarterm{nested-name-specifier\opt} \grammarterm{identifier}'' |
| 1977 | +``\tcode{enum} \grammarterm{nested-name-specifier\opt{}} \grammarterm{identifier}'' |
1978 | 1978 | within the \grammarterm{decl-specifier-seq} of a \grammarterm{member-declaration}
|
1979 | 1979 | is parsed as part of an \grammarterm{enum-base}.
|
1980 | 1980 | \begin{note} This resolves a potential ambiguity between the declaration of an enumeration
|
|
2275 | 2275 |
|
2276 | 2276 | \begin{bnf}
|
2277 | 2277 | \nontermdef{named-namespace-definition}\br
|
2278 |
| - \terminal{inline\opt} \terminal{namespace} attribute-specifier-seq\opt identifier \terminal{\{} namespace-body \terminal{\}} |
| 2278 | + \terminal{inline\opt{}} \terminal{namespace} attribute-specifier-seq\opt{} identifier \terminal{\{} namespace-body \terminal{\}} |
2279 | 2279 | \end{bnf}
|
2280 | 2280 |
|
2281 | 2281 | \begin{bnf}
|
2282 | 2282 | \nontermdef{unnamed-namespace-definition}\br
|
2283 |
| - \terminal{inline\opt} \terminal{namespace} attribute-specifier-seq\opt{} \terminal{\{} namespace-body \terminal{\}} |
| 2283 | + \terminal{inline\opt{}} \terminal{namespace} attribute-specifier-seq\opt{} \terminal{\{} namespace-body \terminal{\}} |
2284 | 2284 | \end{bnf}
|
2285 | 2285 |
|
2286 | 2286 | \begin{bnf}
|
|
2296 | 2296 |
|
2297 | 2297 | \begin{bnf}
|
2298 | 2298 | \nontermdef{namespace-body}\br
|
2299 |
| - declaration-seq\opt |
| 2299 | + declaration-seq\opt{} |
2300 | 2300 | \end{bnf}
|
2301 | 2301 |
|
2302 | 2302 | \pnum
|
|
2478 | 2478 | whose \grammarterm{class-head-name} (Clause \ref{class}) or
|
2479 | 2479 | \grammarterm{enum-head-name}~(\ref{dcl.enum}) is an \grammarterm{identifier}, or
|
2480 | 2480 | whose \grammarterm{elaborated-type-specifier} is of the form \grammarterm{class-key}
|
2481 |
| -\grammarterm{attribute-specifier-seq\opt} \grammarterm{identifier}~(\ref{dcl.type.elab}), or |
| 2481 | +\grammarterm{attribute-specifier-seq\opt{}} \grammarterm{identifier}~(\ref{dcl.type.elab}), or |
2482 | 2482 | that is an \grammarterm{opaque-enum-declaration},
|
2483 | 2483 | declares (or redeclares) its \grammarterm{unqualified-id} or
|
2484 | 2484 | \grammarterm{identifier} as a member of \tcode{N}.
|
|
2607 | 2607 |
|
2608 | 2608 | \begin{bnf}
|
2609 | 2609 | \nontermdef{qualified-namespace-specifier}\br
|
2610 |
| - nested-name-specifier\opt namespace-name |
| 2610 | + nested-name-specifier\opt{} namespace-name |
2611 | 2611 | \end{bnf}
|
2612 | 2612 |
|
2613 | 2613 | \pnum
|
|
2647 | 2647 |
|
2648 | 2648 | \begin{bnf}
|
2649 | 2649 | \nontermdef{using-declarator-list}\br
|
2650 |
| - using-declarator \terminal{...}\opt\br |
2651 |
| - using-declarator-list \terminal{,} using-declarator \terminal{...}\opt |
| 2650 | + using-declarator \terminal{...}\opt{}\br |
| 2651 | + using-declarator-list \terminal{,} using-declarator \terminal{...}\opt{} |
2652 | 2652 | \end{bnf}
|
2653 | 2653 |
|
2654 | 2654 | \begin{bnf}
|
2655 | 2655 | \nontermdef{using-declarator}\br
|
2656 |
| - \terminal{typename\opt} nested-name-specifier unqualified-id |
| 2656 | + \terminal{typename\opt{}} nested-name-specifier unqualified-id |
2657 | 2657 | \end{bnf}
|
2658 | 2658 |
|
2659 | 2659 | \pnum
|
|
3122 | 3122 |
|
3123 | 3123 | \begin{bnf}
|
3124 | 3124 | \nontermdef{using-directive}\br
|
3125 |
| - attribute-specifier-seq\opt{} \terminal{using namespace} nested-name-specifier\opt namespace-name \terminal{;} |
| 3125 | + attribute-specifier-seq\opt{} \terminal{using namespace} nested-name-specifier\opt{} namespace-name \terminal{;} |
3126 | 3126 | \end{bnf}
|
3127 | 3127 |
|
3128 | 3128 | \pnum
|
|
3595 | 3595 |
|
3596 | 3596 | \begin{bnf}
|
3597 | 3597 | \nontermdef{attribute-specifier-seq}\br
|
3598 |
| - attribute-specifier-seq\opt attribute-specifier |
| 3598 | + attribute-specifier-seq\opt{} attribute-specifier |
3599 | 3599 | \end{bnf}
|
3600 | 3600 |
|
3601 | 3601 | \begin{bnf}
|
|
3617 | 3617 |
|
3618 | 3618 | \begin{bnf}
|
3619 | 3619 | \nontermdef{attribute-list}\br
|
3620 |
| - attribute\opt\br |
3621 |
| - attribute-list \terminal{,} attribute\opt\br |
| 3620 | + attribute\opt{}\br |
| 3621 | + attribute-list \terminal{,} attribute\opt{}\br |
3622 | 3622 | attribute \terminal{...}\br
|
3623 | 3623 | attribute-list \terminal{,} attribute \terminal{...}
|
3624 | 3624 | \end{bnf}
|
3625 | 3625 |
|
3626 | 3626 | \begin{bnf}
|
3627 | 3627 | \nontermdef{attribute}\br
|
3628 |
| - attribute-token attribute-argument-clause\opt |
| 3628 | + attribute-token attribute-argument-clause\opt{} |
3629 | 3629 | \end{bnf}
|
3630 | 3630 |
|
3631 | 3631 | \begin{bnf}
|
|
0 commit comments