From Jason Turner

[basic.lookup.elab]

Diff to HTML by rtfpessoa

tmp/tmpqdmvl4ez/{from.md → to.md} RENAMED
@@ -33,37 +33,39 @@ If the *elaborated-type-specifier* has a *nested-name-specifier*,
33
  qualified name lookup is performed, as described in 
34
  [[basic.lookup.qual]], but ignoring any non-type names that have been
35
  declared. If the name lookup does not find a previously declared
36
  *type-name*, the *elaborated-type-specifier* is ill-formed.
37
 
 
 
38
  ``` cpp
39
  struct Node {
40
  struct Node* Next; // OK: Refers to Node at global scope
41
  struct Data* Data; // OK: Declares type Data
42
  // 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
48
- // cannot introduce a qualified type~([dcl.type.elab])
49
- friend struct Glob; // OK: Refers to (as yet) undeclared Glob
50
- // at global scope.
51
- /* ... */
52
  };
53
 
54
  struct Base {
55
  struct Data; // OK: Declares nested Data
56
  struct ::Data* thatData; // OK: Refers to ::Data
57
  struct Base::Data* thisData; // OK: Refers to nested Data
58
  friend class ::Data; // OK: global Data is a friend
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~([dcl.type.elab])
65
  struct Base::Data; // error: cannot introduce a qualified type~([dcl.type.elab])
66
  struct Base::Datum; // error: Datum undefined
67
  struct Base::Data* pBase; // OK: refers to nested Data
68
  ```
69
 
 
 
 
33
  qualified name lookup is performed, as described in 
34
  [[basic.lookup.qual]], but ignoring any non-type names that have been
35
  declared. If the name lookup does not find a previously declared
36
  *type-name*, the *elaborated-type-specifier* is ill-formed.
37
 
38
+ [*Example 1*:
39
+
40
  ``` cpp
41
  struct Node {
42
  struct Node* Next; // OK: Refers to Node at global scope
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~([dcl.type.elab])
50
+ friend struct Glob; // OK: Refers to (as yet) undeclared Glob at global scope.
51
+ ...
 
 
52
  };
53
 
54
  struct Base {
55
  struct Data; // OK: Declares nested Data
56
  struct ::Data* thatData; // OK: Refers to ::Data
57
  struct Base::Data* thisData; // OK: Refers to nested Data
58
  friend class ::Data; // OK: global Data is a friend
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~([dcl.type.elab])
65
  struct Base::Data; // error: cannot introduce a qualified type~([dcl.type.elab])
66
  struct Base::Datum; // error: Datum undefined
67
  struct Base::Data* pBase; // OK: refers to nested Data
68
  ```
69
 
70
+ — *end example*]
71
+