Annex F (informative)
Core undefined behavior
[ub]
F.2
[basic]
: Basics
[ub.basic]
F.2.12
[ub:original.type.implicit.destructor]
Specified in:
[basic.
life]
1
#
The behavior is undefined if a non-trivial implicit destructor call occurs when the type of the object inhabiting the associated storage is not the original type associated with that storage
.
2
#
[
Example
1
:
class
T
{
}
;
struct
B
{
~
B
(
)
;
}
;
void
h
(
)
{
B b;
new
(
&
b
)
T;
}
// undefined behavior at block exit
—
end example
]