From Jason Turner

[conv.lval]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpe6qmf_rb/{from.md → to.md} +19 -4
tmp/tmpe6qmf_rb/{from.md → to.md} RENAMED
@@ -43,13 +43,28 @@ rules:
43
  `T` is volatile-qualified [[intro.execution]], and the glvalue can
44
  refer to an inactive member of a union [[class.union]]. — *end note*]
45
  - Otherwise, if `T` has a class type, the conversion copy-initializes
46
  the result object from the glvalue.
47
  - Otherwise, if the object to which the glvalue refers contains an
48
- invalid pointer value [[basic.stc.dynamic.deallocation]], the behavior
49
- is *implementation-defined*.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  - Otherwise, the object indicated by the glvalue is read
51
- [[defns.access]], and the value contained in the object is the prvalue
52
- result.
 
53
 
54
  [*Note 2*: See also  [[basic.lval]]. — *end note*]
55
 
 
43
  `T` is volatile-qualified [[intro.execution]], and the glvalue can
44
  refer to an inactive member of a union [[class.union]]. — *end note*]
45
  - Otherwise, if `T` has a class type, the conversion copy-initializes
46
  the result object from the glvalue.
47
  - Otherwise, if the object to which the glvalue refers contains an
48
+ invalid pointer value [[basic.compound]], the behavior is
49
+ *implementation-defined*.
50
+ - Otherwise, if the bits in the value representation of the object to
51
+ which the glvalue refers are not valid for the object’s type, the
52
+ behavior is undefined.
53
+ \[*Example 2*:
54
+ ``` cpp
55
+ bool f() {
56
+ bool b = true;
57
+ char c = 42;
58
+ memcpy(&b, &c, 1);
59
+ return b; // undefined behavior if 42 is not a valid value representation for bool
60
+ }
61
+ ```
62
+
63
+ — *end example*]
64
  - Otherwise, the object indicated by the glvalue is read
65
+ [[defns.access]]. Let `V` be the value contained in the object. If `T`
66
+ is an integer type, the prvalue result is the value of type `T`
67
+ congruent [[basic.fundamental]] to `V`, and `V` otherwise.
68
 
69
  [*Note 2*: See also  [[basic.lval]]. — *end note*]
70