Annex F (informative)
Core undefined behavior
[ub]
F.5
[dcl]
: Declarations
[ub.dcl]
F.5.4
[ub:dcl.ref.incompatible.type]
Specified in:
[dcl.
ref]
1
#
Initializing a reference to an object with a value that is not type-accessible (
[basic.
lval]
) through the type of the reference has undefined behavior
.
2
#
[
Example
1
:
float
g;
int
&
i
=
reinterpret_cast
<
int
&
>
(
g
)
;
// undefined behavior
—
end example
]