|
305 | 305 | \end{codeblock}
|
306 | 306 | \end{example}
|
307 | 307 |
|
| 308 | +\rSec2[ub.basic.compound]{Compound types} |
| 309 | + |
| 310 | +\pnum |
| 311 | +\ubxref{basic.compound.invalid.pointer] \\ |
| 312 | +Indirection or |
| 313 | +the invocation of a deallocation function |
| 314 | +with an invalid pointer value |
| 315 | +has undefined behavior. |
| 316 | + |
| 317 | +\pnum |
| 318 | +\begin{example} |
| 319 | +\begin{codeblock} |
| 320 | +void f() |
| 321 | +{ |
| 322 | + int *x = new int{5}; |
| 323 | + delete x; |
| 324 | + int y = *x; // undefined behavior |
| 325 | + delete x; // undefined behavior |
| 326 | +} |
| 327 | +\end{codeblock} |
| 328 | +\end{example} |
| 329 | + |
308 | 330 |
|
309 | 331 | \rSec2[ub.intro.execution]{Sequential execution}
|
310 | 332 |
|
|
660 | 682 | \rSec2[ub.expr.ref]{Class member access}
|
661 | 683 |
|
662 | 684 | \pnum
|
663 |
| -\ubxref{expr.ref.not.similar} \\ |
| 685 | +\ubxref{expr.ref.member.not.similar} \\ |
664 | 686 | If \tcode{E2} is a non-static member and the result of \tcode{E1} is an object whose type
|
665 | 687 | is not similar\iref{conv.qual} to the type of \tcode{E1}, the behavior is undefined.
|
666 | 688 |
|
|
1053 | 1075 | \end{example}
|
1054 | 1076 |
|
1055 | 1077 | \pnum
|
1056 |
| -\ubxref{expr.add.polymorphic} \\ |
| 1078 | +\ubxref{expr.add.not.similar} \\ |
1057 | 1079 | For addition or subtraction, if the expressions P or Q have type ``pointer to cv T'', where T and the array
|
1058 | 1080 | element type are not similar \iref{conv.rval}, the behavior is undefined.
|
1059 | 1081 |
|
|
1558 | 1580 | \rSec2[ub.class.cdtor]{Construction and destruction}
|
1559 | 1581 |
|
1560 | 1582 | \pnum
|
1561 |
| -\ubxref{class.cdtor.before.ctor.before.ctor} \\ |
| 1583 | +\ubxref{class.cdtor.before.ctor} \\ |
1562 | 1584 | For an object with a non-trivial constructor, referring to any non-static member or base class of the object
|
1563 | 1585 | before the constructor begins execution results in undefined behavior. For an object with a non-trivial
|
1564 | 1586 | destructor, referring to any non-static member or base class of the object after the destructor finishes execution
|
|
1608 | 1630 |
|
1609 | 1631 |
|
1610 | 1632 | \pnum
|
1611 |
| -\ubxref{class.cdtor.before.ctor.after.dtor} \\ |
| 1633 | +\ubxref{class.cdtor.after.dtor} \\ |
1612 | 1634 | For an object with a non-trivial destructor,
|
1613 | 1635 | referring to any non-static member or base class of the object
|
1614 | 1636 | after the destructor finishes execution
|
|
0 commit comments