Skip to content

Commit ab27d48

Browse files
committed
[conv.lval] Add example of erroneous 'trap representation' being read
1 parent 4b3f32a commit ab27d48

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

source/expressions.tex

+14
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,20 @@
678678
If the result is an erroneous value\iref{basic.indet} and
679679
the bits in the value representation are not valid for the object's type,
680680
the behavior is undefined.
681+
\begin{example}
682+
\begin{codeblock}
683+
int main() {
684+
bool a;
685+
bool b = a;
686+
}
687+
\end{codeblock}
688+
If the value of the byte(s) of the object representation of \tcode{a}
689+
are determined by the implementation so that the
690+
bits of the value representation of \tcode{a}
691+
correspond to \tcode{true} or \tcode{false},
692+
the lvalue-to-rvalue conversion during the initialization of \tcode{b}
693+
has erroneous behavior, and undefined behavior otherwise.
694+
\end{example}
681695
\end{itemize}
682696

683697
\pnum

0 commit comments

Comments
 (0)