Annex F (informative)
Core undefined behavior
[ub]
F.6
[class]
: Classes
[ub.class]
F.6.7
[ub:class.cdtor.form.pointer]
Specified in:
[class.
cdtor]
1
#
When forming a pointer to a direct non-static member of a class, construction must have started and destruction must not have finished otherwise the behavior is undefined
.
2
#
[
Example
1
:
struct
A
{
int
i
=
0
;
}
;
struct
B
{
int
*
p; A a; B
(
)
:
p
(
&
a
.
i
)
{
}
// undefined behavior
}
;
—
end example
]