Annex F (informative)
Core undefined behavior
[ub]
F.2
[basic]
: Basics
[ub.basic]
F.2.17
[ub:basic.compound.invalid.pointer]
Specified in:
[basic.
compound]
1
#
Indirection or the invocation of a deallocation function with a pointer value referencing storage that has been freed has undefined behavior
.
(Most other uses of such a pointer have implementation-defined behavior
.
)
2
#
[
Example
1
:
void
f
(
)
{
int
*
x
=
new
int
{
5
}
;
delete
x;
int
y
=
*
x;
// undefined behavior
delete
x;
// undefined behavior
}
—
end example
]