File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 790790
791791\pnum
792792\begin {example }
793+ If \tcode {float} does not adhere to \IsoFloatUndated {}
794+ and cannot represent positive infinty,
795+ a sufficiently large \tcode {double} value will be
796+ outside the (finite) range of \tcode {float}.
793797\begin {codeblock }
794798void f() {
795- double d = FLT_MAX * 16 ;
799+ double d = FLT_MAX;
796800 d *= 16;
797801 float f = static_cast<float>(d); // undefined behavior.
798802}
799803\end {codeblock }
800804\end {example }
801805
802806
803- \pnum
804- \begin {example }
805- \begin {codeblock }
806-
807- \end {codeblock }
808- \end {example }
809-
810807\pnum
811808\ubxref {expr.static.cast.downcast.wrong.derived.type } \\
812809Down-casting to the wrong derived type is undefined behavior.
13471344\begin {codeblock }
13481345extern int &ir1;
13491346int i2 = ir1; // undefined behavior, \tcode {ir1} not yet initialized
1350- int ir1 = 17;
1347+ int i3 = 17;
1348+ int &ir1 = i3;
13511349\end {codeblock }
13521350\end {example }
13531351
16741672}
16751673void f()
16761674{
1677- X& px = &g();
1675+ X* px = &g();
16781676 px->~X();
1679- int*p = px->i; // undefined behavior
1677+ int j = px->i; // undefined behavior
16801678}
16811679\end {codeblock }
16821680\end {example }
You can’t perform that action at this time.
0 commit comments