tmp/tmpculpymzb/{from.md → to.md}
RENAMED
|
@@ -15,11 +15,11 @@ attribute-specifier:
|
|
| 15 |
```
|
| 16 |
|
| 17 |
``` bnf
|
| 18 |
alignment-specifier:
|
| 19 |
'alignas (' type-id '...'ₒₚₜ ')'
|
| 20 |
-
'alignas ('
|
| 21 |
```
|
| 22 |
|
| 23 |
``` bnf
|
| 24 |
attribute-list:
|
| 25 |
attributeₒₚₜ
|
|
@@ -102,18 +102,18 @@ For an *attribute-token* not specified in this International Standard,
|
|
| 102 |
the behavior is *implementation-defined*.
|
| 103 |
|
| 104 |
Two consecutive left square bracket tokens shall appear only when
|
| 105 |
introducing an *attribute-specifier*. If two consecutive left square
|
| 106 |
brackets appear where an *attribute-specifier* is not allowed, the
|
| 107 |
-
program is ill
|
| 108 |
production.
|
| 109 |
|
| 110 |
``` cpp
|
| 111 |
int p[10];
|
| 112 |
void f() {
|
| 113 |
int x = 42, y[5];
|
| 114 |
-
int(p[[x] { return x; }()]); // error:
|
| 115 |
// declarator-id and not a function-style cast of
|
| 116 |
// an element of p.
|
| 117 |
y[[] { return 2; }()] = 2; // error even though attributes are not allowed
|
| 118 |
// in this context.
|
| 119 |
}
|
|
|
|
| 15 |
```
|
| 16 |
|
| 17 |
``` bnf
|
| 18 |
alignment-specifier:
|
| 19 |
'alignas (' type-id '...'ₒₚₜ ')'
|
| 20 |
+
'alignas (' constant-expression '...'ₒₚₜ ')'
|
| 21 |
```
|
| 22 |
|
| 23 |
``` bnf
|
| 24 |
attribute-list:
|
| 25 |
attributeₒₚₜ
|
|
|
|
| 102 |
the behavior is *implementation-defined*.
|
| 103 |
|
| 104 |
Two consecutive left square bracket tokens shall appear only when
|
| 105 |
introducing an *attribute-specifier*. If two consecutive left square
|
| 106 |
brackets appear where an *attribute-specifier* is not allowed, the
|
| 107 |
+
program is ill-formed even if the brackets match an alternative grammar
|
| 108 |
production.
|
| 109 |
|
| 110 |
``` cpp
|
| 111 |
int p[10];
|
| 112 |
void f() {
|
| 113 |
int x = 42, y[5];
|
| 114 |
+
int(p[[x] { return x; }()]); // error: invalid attribute on a nested
|
| 115 |
// declarator-id and not a function-style cast of
|
| 116 |
// an element of p.
|
| 117 |
y[[] { return 2; }()] = 2; // error even though attributes are not allowed
|
| 118 |
// in this context.
|
| 119 |
}
|