Annex F (informative)
Core undefined behavior
[ub]
F.6
[class]
: Classes
[ub.class]
F.6.1
[ub:class.dtor.no.longer.exists]
Specified in:
[class.
dtor]
1
#
Once a destructor is invoked for an object, the object's lifetime has ended; the behavior is undefined if the destructor is invoked for an object whose lifetime has ended
.
2
#
[
Example
1
:
struct
A
{
~
A
(
)
{
}
}
;
int
main
(
)
{
A a; a
.
~
A
(
)
;
}
// undefined behavior, lifetime of
a
already ended before implicit destructor
—
end example
]