From Jason Turner

[expr.prim.id.dtor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9li5boz1/{from.md → to.md} +31 -0
tmp/tmp9li5boz1/{from.md → to.md} RENAMED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Destruction <a id="expr.prim.id.dtor">[[expr.prim.id.dtor]]</a>
2
+
3
+ An *id-expression* that denotes the destructor of a type `T` names the
4
+ destructor of `T` if `T` is a class type [[class.dtor]], otherwise the
5
+ *id-expression* is said to name a *pseudo-destructor*.
6
+
7
+ If the *id-expression* names a pseudo-destructor, `T` shall be a scalar
8
+ type and the *id-expression* shall appear as the right operand of a
9
+ class member access [[expr.ref]] that forms the *postfix-expression* of
10
+ a function call [[expr.call]].
11
+
12
+ [*Note 1*: Such a call ends the lifetime of the object ([[expr.call]],
13
+ [[basic.life]]). — *end note*]
14
+
15
+ [*Example 1*:
16
+
17
+ ``` cpp
18
+ struct C { };
19
+ void f() {
20
+ C * pc = new C;
21
+ using C2 = C;
22
+ pc->C::~C2(); // OK, destroys *pc
23
+ C().C::~C(); // undefined behavior: temporary of type C destroyed twice
24
+ using T = int;
25
+ 0 .T::~T(); // OK, no effect
26
+ 0.T::~T(); // error: 0.T is a user-defined-floating-point-literal[lex.ext]
27
+ }
28
+ ```
29
+
30
+ — *end example*]
31
+