From Jason Turner

[expr.type]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9i38tq5g/{from.md → to.md} +66 -0
tmp/tmp9i38tq5g/{from.md → to.md} RENAMED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Type <a id="expr.type">[[expr.type]]</a>
2
+
3
+ If an expression initially has the type “reference to `T`” (
4
+ [[dcl.ref]], [[dcl.init.ref]]), the type is adjusted to `T` prior to any
5
+ further analysis. The expression designates the object or function
6
+ denoted by the reference, and the expression is an lvalue or an xvalue,
7
+ depending on the expression.
8
+
9
+ [*Note 1*: Before the lifetime of the reference has started or after it
10
+ has ended, the behavior is undefined (see 
11
+ [[basic.life]]). — *end note*]
12
+
13
+ If a prvalue initially has the type “cv `T`”, where `T` is a
14
+ cv-unqualified non-class, non-array type, the type of the expression is
15
+ adjusted to `T` prior to any further analysis.
16
+
17
+ The *composite pointer type* of two operands `p1` and `p2` having types
18
+ `T1` and `T2`, respectively, where at least one is a pointer or
19
+ pointer-to-member type or `std::nullptr_t`, is:
20
+
21
+ - if both `p1` and `p2` are null pointer constants, `std::nullptr_t`;
22
+ - if either `p1` or `p2` is a null pointer constant, `T2` or `T1`,
23
+ respectively;
24
+ - if `T1` or `T2` is “pointer to *cv1* `void`” and the other type is
25
+ “pointer to *cv2* `T`”, where `T` is an object type or `void`,
26
+ “pointer to *cv12* `void`”, where *cv12* is the union of *cv1* and
27
+ *cv2*;
28
+ - if `T1` or `T2` is “pointer to `noexcept` function” and the other type
29
+ is “pointer to function”, where the function types are otherwise the
30
+ same, “pointer to function”;
31
+ - if `T1` is “pointer to *cv1* `C1`” and `T2` is “pointer to *cv2*
32
+ `C2`”, where `C1` is reference-related to `C2` or `C2` is
33
+ reference-related to `C1` [[dcl.init.ref]], the cv-combined type
34
+ [[conv.qual]] of `T1` and `T2` or the cv-combined type of `T2` and
35
+ `T1`, respectively;
36
+ - if `T1` or `T2` is “pointer to member of `C1` of type function”, the
37
+ other type is “pointer to member of `C2` of type `noexcept` function”,
38
+ and `C1` is reference-related to `C2` or `C2` is reference-related to
39
+ `C1` [[dcl.init.ref]], where the function types are otherwise the
40
+ same, “pointer to member of `C2` of type function” or “pointer to
41
+ member of `C1` of type function”, respectively;
42
+ - if `T1` is “pointer to member of `C1` of type *cv1* `U`” and `T2` is
43
+ “pointer to member of `C2` of type *cv2* `U`”, for some non-function
44
+ type `U`, where `C1` is reference-related to `C2` or `C2` is
45
+ reference-related to `C1` [[dcl.init.ref]], the cv-combined type of
46
+ `T2` and `T1` or the cv-combined type of `T1` and `T2`, respectively;
47
+ - if `T1` and `T2` are similar types [[conv.qual]], the cv-combined type
48
+ of `T1` and `T2`;
49
+ - otherwise, a program that necessitates the determination of a
50
+ composite pointer type is ill-formed.
51
+
52
+ [*Example 1*:
53
+
54
+ ``` cpp
55
+ typedef void *p;
56
+ typedef const int *q;
57
+ typedef int **pi;
58
+ typedef const int **pci;
59
+ ```
60
+
61
+ The composite pointer type of `p` and `q` is “pointer to `const void`”;
62
+ the composite pointer type of `pi` and `pci` is “pointer to `const`
63
+ pointer to `const int`”.
64
+
65
+ — *end example*]
66
+