|
326 | 326 | a defaulted copy/move constructor or copy/move assignment operator |
327 | 327 | for a union of type \tcode{U} with a glvalue argument |
328 | 328 | that does not denote an object of type \cv{}~\tcode{U} within its lifetime, |
329 | | -the behavior is undefined. |
| 329 | +the behavior is undefined.\ubdef{expr.basic.lvalue.union.initialization} |
330 | 330 | \begin{note} |
331 | 331 | In C, an entire object of structure type can be accessed, e.g., using assignment. |
332 | 332 | By contrast, \Cpp{} has no notion of accessing an object of class type |
|
345 | 345 | If a pointer to $X$ would be valid in |
346 | 346 | the context of the evaluation of the expression\iref{basic.fundamental}, |
347 | 347 | the result designates $X$; |
348 | | -otherwise, the behavior is undefined. |
| 348 | +otherwise, the behavior is undefined.\ubdef{expr.type.reference.lifetime} |
349 | 349 | \begin{note} |
350 | 350 | Before the lifetime of the reference has started or after it has ended, |
351 | 351 | the behavior is undefined (see~\ref{basic.life}). |
|
686 | 686 |
|
687 | 687 | \item Otherwise, if the bits in the value representation of |
688 | 688 | the object to which the glvalue refers |
689 | | -are not valid for the object's type, the behavior is undefined. |
| 689 | +are not valid for the object's type, the behavior is undefined.\ubdef{conv.lval.valid.representation} |
690 | 690 | \begin{example} |
691 | 691 | \begin{codeblock} |
692 | 692 | bool f() { |
|
1003 | 1003 | integer type. The conversion truncates; that is, the fractional part is |
1004 | 1004 | discarded. |
1005 | 1005 | \indextext{value!undefined unrepresentable integral}% |
1006 | | -The behavior is undefined\ubdef{conv.fpint.not.represented} if the truncated value cannot be represented |
| 1006 | +The behavior is undefined\ubdef{conv.fpint.float.not.represented} if the truncated value cannot be represented |
1007 | 1007 | in the destination type. |
1008 | 1008 | \begin{note} |
1009 | 1009 | If the destination type is \keyword{bool}, see~\ref{conv.bool}. |
|
1024 | 1024 | exactly as a value of the floating-point type. |
1025 | 1025 | \end{note} |
1026 | 1026 | If the value being converted is |
1027 | | -outside the range of values that can be represented, the behavior is undefined. If the |
| 1027 | +outside the range of values that can be represented, the behavior is undefined.\ubdef{conv.fpint.int.not.represented} |
| 1028 | +If the |
1028 | 1029 | source type is \keyword{bool}, the value \keyword{false} is converted to zero and the value |
1029 | 1030 | \keyword{true} is converted to one. |
1030 | 1031 |
|
|
1077 | 1078 | that is |
1078 | 1079 | within its lifetime or |
1079 | 1080 | within its period of construction or destruction\iref{class.cdtor}, |
1080 | | -the behavior is undefined. |
| 1081 | +the behavior is undefined.\ubdef{conv.ptr.virtual.base} |
1081 | 1082 | Otherwise, |
1082 | 1083 | the result is a pointer to the base class subobject of |
1083 | 1084 | the derived class object. |
|
1111 | 1112 | \tcode{D}, a program that necessitates this conversion is ill-formed. |
1112 | 1113 | If class \tcode{D} does not contain the original member and |
1113 | 1114 | is not a base class of the class containing the original member, |
1114 | | -the behavior is undefined. Otherwise, |
| 1115 | +the behavior is undefined.\ubdef{conv.member.missing.member} |
| 1116 | +Otherwise, |
1115 | 1117 | the result of the conversion refers to the same member as the pointer to |
1116 | 1118 | member before the conversion took place, but it refers to the base class |
1117 | 1119 | member as if it were a member of the derived class. The result refers to |
|
4392 | 4394 | or direct base class relationship and |
4393 | 4395 | the result of \tcode{E1} is an object whose type |
4394 | 4396 | is not similar\iref{conv.qual} to the type of \tcode{E1}, |
4395 | | -the behavior is undefined\ubdef{expr.ref.not.similar}. |
| 4397 | +the behavior is undefined\ubdef{expr.ref.member.not.similar}. |
4396 | 4398 | \begin{example} |
4397 | 4399 | \begin{codeblock} |
4398 | 4400 | struct A { int i; }; |
|
4528 | 4530 | that is |
4529 | 4531 | within its lifetime or |
4530 | 4532 | within its period of construction or destruction, |
4531 | | -the behavior is undefined. |
| 4533 | +the behavior is undefined.\ubdef{expr.dynamic.cast.lifetime} |
4532 | 4534 |
|
4533 | 4535 | \pnum |
4534 | 4536 | If \tcode{T} is ``pointer to \cv{} \keyword{void}'', then the result |
|
4848 | 4850 | the result of the conversion is |
4849 | 4851 | an \impldef{result of inexact floating-point conversion} choice of |
4850 | 4852 | either of those values. |
4851 | | -Otherwise, the behavior is undefined\ubdef{expr.static.cast.downcast.wrong.derived.type}. |
| 4853 | +Otherwise, the behavior is undefined\ubdef{expr.static.cast.fp.outside.range}. |
4852 | 4854 |
|
4853 | 4855 | \pnum |
4854 | 4856 | \indextext{cast!base class}% |
|
4869 | 4871 | ``pointer to \cvqual{cv1} \tcode{B}'' points to a \tcode{B} that is |
4870 | 4872 | actually a base class subobject of an object of type \tcode{D}, the resulting |
4871 | 4873 | pointer points to the enclosing object of type \tcode{D}. Otherwise, the |
4872 | | -behavior is undefined. |
| 4874 | +behavior is undefined\ubdef{expr.static.cast.downcast.wrong.derived.type}. |
4873 | 4875 |
|
4874 | 4876 | \pnum |
4875 | 4877 | \indextext{cast!pointer-to-member}% |
|
5270 | 5272 | The operator yields an lvalue of type \tcode{T}. |
5271 | 5273 | If the operand points to an object or function, |
5272 | 5274 | the result denotes that object or function; |
5273 | | -otherwise, the behavior is undefined except as specified in \ref{expr.typeid}. |
| 5275 | +otherwise, the behavior is undefined except as specified in \ref{expr.typeid} |
| 5276 | +\ubdef{expr.unary.dereference}. |
5274 | 5277 | \begin{note} |
5275 | 5278 | Indirection through a pointer to an out-of-lifetime object is valid\iref{basic.life}. |
5276 | 5279 | \end{note} |
|
7340 | 7343 | \pnum |
7341 | 7344 | For addition or subtraction, if the expressions \tcode{P} or \tcode{Q} have |
7342 | 7345 | type ``pointer to \cv{}~\tcode{T}'', where \tcode{T} and the array element type |
7343 | | -are not similar\iref{conv.qual}, the behavior is undefined\ubdef{expr.add.polymorphic}. |
| 7346 | +are not similar\iref{conv.qual}, the behavior is undefined\ubdef{expr.add.not.similar}. |
7344 | 7347 | \begin{example} |
7345 | 7348 | \begin{codeblock} |
7346 | 7349 | int arr[5] = {1, 2, 3, 4, 5}; |
|
0 commit comments