[expr.prim.id.dtor]

# 7 Expressions [[expr]](./#expr)

## 7.5 Primary expressions [[expr.prim]](expr.prim#id.dtor)

### 7.5.5 Names [[expr.prim.id]](expr.prim.id#dtor)

#### 7.5.5.5 Destruction [expr.prim.id.dtor]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L2031)

An [*id-expression*](expr.prim.id.general#nt:id-expression "7.5.5.1 General [expr.prim.id.general]") that denotes the destructor of a type T names the destructor of T if T is a class type ([[class.dtor]](class.dtor "11.4.7 Destructors")),
otherwise the [*id-expression*](expr.prim.id.general#nt:id-expression "7.5.5.1 General [expr.prim.id.general]") is said
to name a [*pseudo-destructor*](#def:pseudo-destructor "7.5.5.5 Destruction [expr.prim.id.dtor]")[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L2040)

If the [*id-expression*](expr.prim.id.general#nt:id-expression "7.5.5.1 General [expr.prim.id.general]") names a pseudo-destructor,T shall be a scalar type and
the [*id-expression*](expr.prim.id.general#nt:id-expression "7.5.5.1 General [expr.prim.id.general]") shall appear
as the right operand of a class member access ([[expr.ref]](expr.ref "7.6.1.5 Class member access")) that forms
the [*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1 General [expr.post.general]") of a function call ([[expr.call]](expr.call "7.6.1.3 Function call"))[.](#2.sentence-1)

[*Note [1](#note-1)*:

Such a call ends the lifetime of the object ([[expr.call]](expr.call "7.6.1.3 Function call"), [[basic.life]](basic.life "6.8.4 Lifetime"))[.](#2.sentence-2)

â *end note*]

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L2050)

[*Example [1](#example-1)*: struct C { };void f() { C * pc = new C; using C2 = C;
 pc->C::~C2(); // OK, destroys *pc C().C::~C(); // undefined behavior: temporary of type C destroyed twiceusing T = int; 0 .T::~T(); // OK, no effect0.T::~T(); // error: 0.T is a [*user-defined-floating-point-literal*](lex.ext#nt:user-defined-floating-point-literal "5.13.9 User-defined literals [lex.ext]") ([[lex.ext]](lex.ext "5.13.9 User-defined literals"))} â *end example*]
