Annex F (informative)
Core undefined behavior
[ub]
F.5
[dcl]
: Declarations
[ub.dcl]
F.5.3
[ub:dcl.ref.incompatible.function]
Specified in:
[dcl.
ref]
1
#
Initializing a reference to a function with a value that is a function that is not call-compatible (
[expr.
call]
) with the type of the reference has undefined behavior
.
2
#
[
Example
1
:
void
f
(
float
x
)
;
void
(
&
g
)
(
int
)
=
reinterpret_cast
<
void
(
&
)
(
int
)
>
(
f
)
;
// undefined behavior
—
end example
]