From b1822f70e6a9277e153e9d36ade03b78f036fbbb Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Wed, 5 Jun 2024 13:49:03 +0200 Subject: [PATCH] [conv.lval] Add example of erroneous 'trap representation' being read --- source/expressions.tex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/expressions.tex b/source/expressions.tex index 683b30137f..f2b1828940 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -678,6 +678,20 @@ If the result is an erroneous value\iref{basic.indet} and the bits in the value representation are not valid for the object's type, the behavior is undefined. +\begin{example} +\begin{codeblock} +int main() { + bool a; + bool b = a; +} +\end{codeblock} +If the values of the bytes of the object representation of \tcode{a} +are determined by the implementation so that the +bits of the value representation of \tcode{a} +correspond to \tcode{true} or \tcode{false}, +the lvalue-to-rvalue conversion during the initialization of \tcode{b} +has erroneous behavior, and undefined behavior otherwise. +\end{example} \end{itemize} \pnum