tmp/tmp2ecmx0f2/{from.md → to.md}
RENAMED
|
@@ -1,11 +1,10 @@
|
|
| 1 |
### Elaborated type specifiers <a id="basic.lookup.elab">[[basic.lookup.elab]]</a>
|
| 2 |
|
| 3 |
-
An *elaborated-type-specifier*
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
[[basic.scope.hiding]]).
|
| 7 |
|
| 8 |
If the *elaborated-type-specifier* has no *nested-name-specifier*, and
|
| 9 |
unless the *elaborated-type-specifier* appears in a declaration with the
|
| 10 |
following form:
|
| 11 |
|
|
@@ -37,18 +36,17 @@ declared. If the name lookup does not find a previously declared
|
|
| 37 |
|
| 38 |
[*Example 1*:
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
struct Node {
|
| 42 |
-
struct Node* Next; // OK: Refers to
|
| 43 |
-
struct Data* Data; // OK: Declares type Data
|
| 44 |
-
// at global scope and member Data
|
| 45 |
};
|
| 46 |
|
| 47 |
struct Data {
|
| 48 |
struct Node* Node; // OK: Refers to Node at global scope
|
| 49 |
-
friend struct ::Glob; // error: Glob is not declared, cannot introduce a qualified type
|
| 50 |
friend struct Glob; // OK: Refers to (as yet) undeclared Glob at global scope.
|
| 51 |
...
|
| 52 |
};
|
| 53 |
|
| 54 |
struct Base {
|
|
@@ -59,12 +57,12 @@ struct Base {
|
|
| 59 |
friend class Data; // OK: nested Data is a friend
|
| 60 |
struct Data { ... }; // Defines nested Data
|
| 61 |
};
|
| 62 |
|
| 63 |
struct Data; // OK: Redeclares Data at global scope
|
| 64 |
-
struct ::Data; // error: cannot introduce a qualified type
|
| 65 |
-
struct Base::Data; // error: cannot introduce a qualified type
|
| 66 |
struct Base::Datum; // error: Datum undefined
|
| 67 |
struct Base::Data* pBase; // OK: refers to nested Data
|
| 68 |
```
|
| 69 |
|
| 70 |
— *end example*]
|
|
|
|
| 1 |
### Elaborated type specifiers <a id="basic.lookup.elab">[[basic.lookup.elab]]</a>
|
| 2 |
|
| 3 |
+
An *elaborated-type-specifier* [[dcl.type.elab]] may be used to refer to
|
| 4 |
+
a previously declared *class-name* or *enum-name* even though the name
|
| 5 |
+
has been hidden by a non-type declaration [[basic.scope.hiding]].
|
|
|
|
| 6 |
|
| 7 |
If the *elaborated-type-specifier* has no *nested-name-specifier*, and
|
| 8 |
unless the *elaborated-type-specifier* appears in a declaration with the
|
| 9 |
following form:
|
| 10 |
|
|
|
|
| 36 |
|
| 37 |
[*Example 1*:
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
struct Node {
|
| 41 |
+
struct Node* Next; // OK: Refers to injected-class-name Node
|
| 42 |
+
struct Data* Data; // OK: Declares type Data at global scope and member Data
|
|
|
|
| 43 |
};
|
| 44 |
|
| 45 |
struct Data {
|
| 46 |
struct Node* Node; // OK: Refers to Node at global scope
|
| 47 |
+
friend struct ::Glob; // error: Glob is not declared, cannot introduce a qualified type[dcl.type.elab]
|
| 48 |
friend struct Glob; // OK: Refers to (as yet) undeclared Glob at global scope.
|
| 49 |
...
|
| 50 |
};
|
| 51 |
|
| 52 |
struct Base {
|
|
|
|
| 57 |
friend class Data; // OK: nested Data is a friend
|
| 58 |
struct Data { ... }; // Defines nested Data
|
| 59 |
};
|
| 60 |
|
| 61 |
struct Data; // OK: Redeclares Data at global scope
|
| 62 |
+
struct ::Data; // error: cannot introduce a qualified type[dcl.type.elab]
|
| 63 |
+
struct Base::Data; // error: cannot introduce a qualified type[dcl.type.elab]
|
| 64 |
struct Base::Datum; // error: Datum undefined
|
| 65 |
struct Base::Data* pBase; // OK: refers to nested Data
|
| 66 |
```
|
| 67 |
|
| 68 |
— *end example*]
|