From Jason Turner

[basic.lookup.classref]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpr1zwpqju/{from.md → to.md} +19 -20
tmp/tmpr1zwpqju/{from.md → to.md} RENAMED
@@ -1,21 +1,20 @@
1
  ### Class member access <a id="basic.lookup.classref">[[basic.lookup.classref]]</a>
2
 
3
- In a class member access expression ([[expr.ref]]), if the `.` or `->`
4
  token is immediately followed by an *identifier* followed by a `<`, the
5
  identifier must be looked up to determine whether the `<` is the
6
- beginning of a template argument list ([[temp.names]]) or a less-than
7
  operator. The identifier is first looked up in the class of the object
8
- expression. If the identifier is not found, it is then looked up in the
9
- context of the entire *postfix-expression* and shall name a class
10
- template.
11
 
12
- If the *id-expression* in a class member access ([[expr.ref]]) is an
13
  *unqualified-id*, and the type of the object expression is of a class
14
- type `C`, the *unqualified-id* is looked up in the scope of class `C`.
15
- For a pseudo-destructor call ([[expr.pseudo]]), the *unqualified-id* is
16
- looked up in the context of the complete *postfix-expression*.
17
 
18
  If the *unqualified-id* is `~`*type-name*, the *type-name* is looked up
19
  in the context of the entire *postfix-expression*. If the type `T` of
20
  the object expression is of a class type `C`, the *type-name* is also
21
  looked up in the scope of class `C`. At least one of the lookups shall
@@ -43,14 +42,14 @@ the form
43
 
44
  ``` cpp
45
  class-name-or-namespace-name::...
46
  ```
47
 
48
- the *class-name-or-namespace-name* following the `.` or `->` operator is
49
- first looked up in the class of the object expression and the name, if
50
- found, is used. Otherwise it is looked up in the context of the entire
51
- *postfix-expression*.
52
 
53
  [*Note 1*: See  [[basic.lookup.qual]], which describes the lookup of a
54
  name before `::`, which will only find a type or namespace
55
  name. — *end note*]
56
 
@@ -58,23 +57,23 @@ If the *qualified-id* has the form
58
 
59
  ``` cpp
60
  ::class-name-or-namespace-name::...
61
  ```
62
 
63
- the *class-name-or-namespace-name* is looked up in global scope as a
64
  *class-name* or *namespace-name*.
65
 
66
- If the *nested-name-specifier* contains a *simple-template-id* (
67
- [[temp.names]]), the names in its *template-argument*s are looked up in
68
  the context in which the entire *postfix-expression* occurs.
69
 
70
  If the *id-expression* is a *conversion-function-id*, its
71
  *conversion-type-id* is first looked up in the class of the object
72
- expression and the name, if found, is used. Otherwise it is looked up in
73
- the context of the entire *postfix-expression*. In each of these
74
- lookups, only names that denote types or templates whose specializations
75
- are types are considered.
76
 
77
  [*Example 2*:
78
 
79
  ``` cpp
80
  struct A { };
 
1
  ### Class member access <a id="basic.lookup.classref">[[basic.lookup.classref]]</a>
2
 
3
+ In a class member access expression [[expr.ref]], if the `.` or `->`
4
  token is immediately followed by an *identifier* followed by a `<`, the
5
  identifier must be looked up to determine whether the `<` is the
6
+ beginning of a template argument list [[temp.names]] or a less-than
7
  operator. The identifier is first looked up in the class of the object
8
+ expression [[class.member.lookup]]. If the identifier is not found, it
9
+ is then looked up in the context of the entire *postfix-expression* and
10
+ shall name a template whose specializations are types.
11
 
12
+ If the *id-expression* in a class member access [[expr.ref]] is an
13
  *unqualified-id*, and the type of the object expression is of a class
14
+ type `C`, the *unqualified-id* is looked up in the scope of class `C`
15
+ [[class.member.lookup]].
 
16
 
17
  If the *unqualified-id* is `~`*type-name*, the *type-name* is looked up
18
  in the context of the entire *postfix-expression*. If the type `T` of
19
  the object expression is of a class type `C`, the *type-name* is also
20
  looked up in the scope of class `C`. At least one of the lookups shall
 
42
 
43
  ``` cpp
44
  class-name-or-namespace-name::...
45
  ```
46
 
47
+ the `class-name-or-namespace-name` following the `.` or `->` operator is
48
+ first looked up in the class of the object expression
49
+ [[class.member.lookup]] and the name, if found, is used. Otherwise it is
50
+ looked up in the context of the entire *postfix-expression*.
51
 
52
  [*Note 1*: See  [[basic.lookup.qual]], which describes the lookup of a
53
  name before `::`, which will only find a type or namespace
54
  name. — *end note*]
55
 
 
57
 
58
  ``` cpp
59
  ::class-name-or-namespace-name::...
60
  ```
61
 
62
+ the `class-name-or-namespace-name` is looked up in global scope as a
63
  *class-name* or *namespace-name*.
64
 
65
+ If the *nested-name-specifier* contains a *simple-template-id*
66
+ [[temp.names]], the names in its *template-argument*s are looked up in
67
  the context in which the entire *postfix-expression* occurs.
68
 
69
  If the *id-expression* is a *conversion-function-id*, its
70
  *conversion-type-id* is first looked up in the class of the object
71
+ expression [[class.member.lookup]] and the name, if found, is used.
72
+ Otherwise it is looked up in the context of the entire
73
+ *postfix-expression*. In each of these lookups, only names that denote
74
+ types or templates whose specializations are types are considered.
75
 
76
  [*Example 2*:
77
 
78
  ``` cpp
79
  struct A { };