Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b1822f7

Browse filesBrowse files
committed
[conv.lval] Add example of erroneous 'trap representation' being read
1 parent 4b3f32a commit b1822f7
Copy full SHA for b1822f7

File tree

1 file changed

+14
-0
lines changed
Filter options

1 file changed

+14
-0
lines changed

‎source/expressions.tex

Copy file name to clipboardExpand all lines: source/expressions.tex
+14Lines changed: 14 additions & 0 deletions
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 values of the bytes 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.