From Jason Turner

[expr.ref]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpsqegrbmm/{from.md → to.md} +31 -23
tmp/tmpsqegrbmm/{from.md → to.md} RENAMED
@@ -5,29 +5,34 @@ followed by the keyword `template` ([[temp.names]]), and then followed
5
  by an *id-expression*, is a postfix expression. The postfix expression
6
  before the dot or arrow is evaluated;[^6] the result of that evaluation,
7
  together with the *id-expression*, determines the result of the entire
8
  postfix expression.
9
 
10
- For the first option (dot) the first expression shall have complete
11
- class type. For the second option (arrow) the first expression shall
12
- have pointer to complete class type. The expression `E1->E2` is
13
- converted to the equivalent form `(*(E1)).E2`; the remainder of
14
- [[expr.ref]] will address only the first option (dot).[^7] In either
15
- case, the *id-expression* shall name a member of the class or of one of
16
- its base classes. because the name of a class is inserted in its class
17
- scope (Clause  [[class]]), the name of a class is also considered a
18
- nested member of that class. [[basic.lookup.classref]] describes how
19
- names are looked up after the `.` and `->` operators.
 
 
 
 
20
 
21
  Abbreviating *postfix-expression.id-expression* as `E1.E2`, `E1` is
22
- called the *object expression*. The type and value category of `E1.E2`
23
- are determined as follows. In the remainder of  [[expr.ref]], *cq*
24
- represents either `const` or the absence of `const` and *vq* represents
25
- either `volatile` or the absence of `volatile`. *cv* represents an
26
- arbitrary set of cv-qualifiers, as defined in  [[basic.type.qualifier]].
 
27
 
28
- If `E2` is declared to have type “reference to `T`,” then `E1.E2` is an
29
  lvalue; the type of `E1.E2` is `T`. Otherwise, one of the following
30
  rules applies.
31
 
32
  - If `E2` is a static data member and the type of `E2` is `T`, then
33
  `E1.E2` is an lvalue; the expression designates the named member of
@@ -52,22 +57,25 @@ rules applies.
52
  lvalue; the expression designates the static member function. The
53
  type of `E1.E2` is the same type as that of `E2`, namely “function
54
  of parameter-type-list returning `T`”.
55
  - Otherwise, if `E1.E2` refers to a non-static member function and the
56
  type of `E2` is “function of parameter-type-list *cv*
57
- *ref-qualifierₒₚₜ* returning `T`”, then `E1.E2` is a prvalue. The
58
  expression designates a non-static member function. The expression
59
  can be used only as the left-hand operand of a member function
60
- call ([[class.mfct]]). Any redundant set of parentheses surrounding
61
- the expression is ignored ([[expr.prim]]). The type of `E1.E2` is
62
- “function of parameter-type-list *cv* returning `T`”.
 
63
  - If `E2` is a nested type, the expression `E1.E2` is ill-formed.
64
  - If `E2` is a member enumerator and the type of `E2` is `T`, the
65
  expression `E1.E2` is a prvalue. The type of `E1.E2` is `T`.
66
 
67
  If `E2` is a non-static data member or a non-static member function, the
68
  program is ill-formed if the class of which `E2` is directly a member is
69
  an ambiguous base ([[class.member.lookup]]) of the naming class (
70
- [[class.access.base]]) of `E2`. The program is also ill-formed if the
71
- naming class is an ambiguous base of the class type of the object
72
- expression; see  [[class.access.base]].
 
 
73
 
 
5
  by an *id-expression*, is a postfix expression. The postfix expression
6
  before the dot or arrow is evaluated;[^6] the result of that evaluation,
7
  together with the *id-expression*, determines the result of the entire
8
  postfix expression.
9
 
10
+ For the first option (dot) the first expression shall be a glvalue
11
+ having complete class type. For the second option (arrow) the first
12
+ expression shall be a prvalue having pointer to complete class type. The
13
+ expression `E1->E2` is converted to the equivalent form `(*(E1)).E2`;
14
+ the remainder of [[expr.ref]] will address only the first option
15
+ (dot).[^7] In either case, the *id-expression* shall name a member of
16
+ the class or of one of its base classes.
17
+
18
+ [*Note 1*: Because the name of a class is inserted in its class scope
19
+ (Clause  [[class]]), the name of a class is also considered a nested
20
+ member of that class. — *end note*]
21
+
22
+ [*Note 2*: [[basic.lookup.classref]] describes how names are looked up
23
+ after the `.` and `->` operators. — *end note*]
24
 
25
  Abbreviating *postfix-expression.id-expression* as `E1.E2`, `E1` is
26
+ called the *object expression*. If `E2` is a bit-field, `E1.E2` is a
27
+ bit-field. The type and value category of `E1.E2` are determined as
28
+ follows. In the remainder of  [[expr.ref]], *cq* represents either
29
+ `const` or the absence of `const` and *vq* represents either `volatile`
30
+ or the absence of `volatile`. *cv* represents an arbitrary set of
31
+ cv-qualifiers, as defined in  [[basic.type.qualifier]].
32
 
33
+ If `E2` is declared to have type “reference to `T`”, then `E1.E2` is an
34
  lvalue; the type of `E1.E2` is `T`. Otherwise, one of the following
35
  rules applies.
36
 
37
  - If `E2` is a static data member and the type of `E2` is `T`, then
38
  `E1.E2` is an lvalue; the expression designates the named member of
 
57
  lvalue; the expression designates the static member function. The
58
  type of `E1.E2` is the same type as that of `E2`, namely “function
59
  of parameter-type-list returning `T`”.
60
  - Otherwise, if `E1.E2` refers to a non-static member function and the
61
  type of `E2` is “function of parameter-type-list *cv*
62
+ *ref-qualifier*ₒₚₜ returning `T`”, then `E1.E2` is a prvalue. The
63
  expression designates a non-static member function. The expression
64
  can be used only as the left-hand operand of a member function
65
+ call ([[class.mfct]]). \[*Note 3*: Any redundant set of parentheses
66
+ surrounding the expression is ignored (
67
+ [[expr.prim]]). *end note*] The type of `E1.E2` is “function of
68
+ parameter-type-list *cv* returning `T`”.
69
  - If `E2` is a nested type, the expression `E1.E2` is ill-formed.
70
  - If `E2` is a member enumerator and the type of `E2` is `T`, the
71
  expression `E1.E2` is a prvalue. The type of `E1.E2` is `T`.
72
 
73
  If `E2` is a non-static data member or a non-static member function, the
74
  program is ill-formed if the class of which `E2` is directly a member is
75
  an ambiguous base ([[class.member.lookup]]) of the naming class (
76
+ [[class.access.base]]) of `E2`.
77
+
78
+ [*Note 4*: The program is also ill-formed if the naming class is an
79
+ ambiguous base of the class type of the object expression; see 
80
+ [[class.access.base]]. — *end note*]
81