Annex F (informative)
Core undefined behavior
[ub]
F.3
[expr]
: Expressions
[ub.expr]
F.3.5
[ub:conv.lval.valid.representation]
Specified in:
[conv.
lval]
1
#
Performing an lvalue-to-rvalue conversion on an object whose value representation is not valid for its type has undefined behavior
.
2
#
[
Example
1
:
bool
f
(
)
{
bool
b
=
true
;
char
c
=
42
; memcpy
(
&
b,
&
c,
1
)
;
return
b;
// undefined behavior if
42
is not a valid value representation for
bool
}
—
end example
]