|
323 | 323 | a defaulted copy/move constructor or copy/move assignment operator |
324 | 324 | for a union of type \tcode{U} with a glvalue argument |
325 | 325 | that does not denote an object of type \cv{}~\tcode{U} within its lifetime, |
326 | | -the behavior is undefined. |
| 326 | +the behavior is undefined.\ubdef{expr.basic.lvalue.union.initialization} |
327 | 327 | \begin{note} |
328 | 328 | In C, an entire object of structure type can be accessed, e.g., using assignment. |
329 | 329 | By contrast, \Cpp{} has no notion of accessing an object of class type |
|
342 | 342 | If a pointer to $X$ would be valid in |
343 | 343 | the context of the evaluation of the expression\iref{basic.fundamental}, |
344 | 344 | the result designates $X$; |
345 | | -otherwise, the behavior is undefined. |
| 345 | +otherwise, the behavior is undefined.\ubdef{expr.type.reference.lifetime} |
346 | 346 | \begin{note} |
347 | 347 | Before the lifetime of the reference has started or after it has ended, |
348 | 348 | the behavior is undefined (see~\ref{basic.life}). |
|
683 | 683 |
|
684 | 684 | \item Otherwise, if the bits in the value representation of |
685 | 685 | the object to which the glvalue refers |
686 | | -are not valid for the object's type, the behavior is undefined. |
| 686 | +are not valid for the object's type, the behavior is undefined.\ubdef{conv.lval.valid.representation} |
687 | 687 | \begin{example} |
688 | 688 | \begin{codeblock} |
689 | 689 | bool f() { |
|
996 | 996 | integer type. The conversion truncates; that is, the fractional part is |
997 | 997 | discarded. |
998 | 998 | \indextext{value!undefined unrepresentable integral}% |
999 | | -The behavior is undefined\ubdef{conv.fpint.not.represented} if the truncated value cannot be represented |
| 999 | +The behavior is undefined\ubdef{conv.fpint.float.not.represented} if the truncated value cannot be represented |
1000 | 1000 | in the destination type. |
1001 | 1001 | \begin{note} |
1002 | 1002 | If the destination type is \keyword{bool}, see~\ref{conv.bool}. |
|
1017 | 1017 | exactly as a value of the floating-point type. |
1018 | 1018 | \end{note} |
1019 | 1019 | If the value being converted is |
1020 | | -outside the range of values that can be represented, the behavior is undefined. If the |
| 1020 | +outside the range of values that can be represented, the behavior is undefined.\ubdef{conv.fpint.int.not.represented} |
| 1021 | +If the |
1021 | 1022 | source type is \keyword{bool}, the value \keyword{false} is converted to zero and the value |
1022 | 1023 | \keyword{true} is converted to one. |
1023 | 1024 |
|
|
1069 | 1070 | that is |
1070 | 1071 | within its lifetime or |
1071 | 1072 | within its period of construction or destruction\iref{class.cdtor}, |
1072 | | -the behavior is undefined. |
| 1073 | +the behavior is undefined.\ubdef{conv.ptr.virtual.base} |
1073 | 1074 | Otherwise, |
1074 | 1075 | the result is a pointer to the base class subobject of |
1075 | 1076 | the derived class object. |
|
1103 | 1104 | \tcode{D}, a program that necessitates this conversion is ill-formed. |
1104 | 1105 | If class \tcode{D} does not contain the original member and |
1105 | 1106 | is not a base class of the class containing the original member, |
1106 | | -the behavior is undefined. Otherwise, |
| 1107 | +the behavior is undefined.\ubdef{conv.member.missing.member} |
| 1108 | +Otherwise, |
1107 | 1109 | the result of the conversion refers to the same member as the pointer to |
1108 | 1110 | member before the conversion took place, but it refers to the base class |
1109 | 1111 | member as if it were a member of the derived class. The result refers to |
|
4354 | 4356 | (possibly after overload resolution) and |
4355 | 4357 | the result of \tcode{E1} is an object whose type |
4356 | 4358 | is not similar\iref{conv.qual} to the type of \tcode{E1}, |
4357 | | -the behavior is undefined\ubdef{expr.ref.not.similar}. |
| 4359 | +the behavior is undefined\ubdef{expr.ref.member.not.similar}. |
4358 | 4360 | \begin{example} |
4359 | 4361 | \begin{codeblock} |
4360 | 4362 | struct A { int i; }; |
|
4490 | 4492 | that is |
4491 | 4493 | within its lifetime or |
4492 | 4494 | within its period of construction or destruction, |
4493 | | -the behavior is undefined. |
| 4495 | +the behavior is undefined.\ubdef{expr.dynamic.cast.lifetime} |
4494 | 4496 |
|
4495 | 4497 | \pnum |
4496 | 4498 | If \tcode{T} is ``pointer to \cv{} \keyword{void}'', then the result |
|
4810 | 4812 | the result of the conversion is |
4811 | 4813 | an \impldef{result of inexact floating-point conversion} choice of |
4812 | 4814 | either of those values. |
4813 | | -Otherwise, the behavior is undefined\ubdef{expr.static.cast.downcast.wrong.derived.type}. |
| 4815 | +Otherwise, the behavior is undefined\ubdef{expr.static.cast.fp.outside.range}. |
4814 | 4816 |
|
4815 | 4817 | \pnum |
4816 | 4818 | \indextext{cast!base class}% |
|
4831 | 4833 | ``pointer to \cvqual{cv1} \tcode{B}'' points to a \tcode{B} that is |
4832 | 4834 | actually a base class subobject of an object of type \tcode{D}, the resulting |
4833 | 4835 | pointer points to the enclosing object of type \tcode{D}. Otherwise, the |
4834 | | -behavior is undefined. |
| 4836 | +behavior is undefined\ubdef{expr.static.cast.downcast.wrong.derived.type}. |
4835 | 4837 |
|
4836 | 4838 | \pnum |
4837 | 4839 | \indextext{cast!pointer-to-member}% |
|
5236 | 5238 | The operator yields an lvalue of type \tcode{T}. |
5237 | 5239 | If the operand points to an object or function, |
5238 | 5240 | the result denotes that object or function; |
5239 | | -otherwise, the behavior is undefined except as specified in \ref{expr.typeid}. |
| 5241 | +otherwise, the behavior is undefined except as specified in \ref{expr.typeid} |
| 5242 | +\ubdef{expr.unary.dereference}. |
5240 | 5243 | \begin{note} |
5241 | 5244 | \indextext{type!incomplete}% |
5242 | 5245 | Indirection through a pointer to an incomplete type (other than |
|
7228 | 7231 | \pnum |
7229 | 7232 | For addition or subtraction, if the expressions \tcode{P} or \tcode{Q} have |
7230 | 7233 | type ``pointer to \cv{}~\tcode{T}'', where \tcode{T} and the array element type |
7231 | | -are not similar\iref{conv.qual}, the behavior is undefined\ubdef{expr.add.polymorphic}. |
| 7234 | +are not similar\iref{conv.qual}, the behavior is undefined\ubdef{expr.add.not.similar}. |
7232 | 7235 | \begin{example} |
7233 | 7236 | \begin{codeblock} |
7234 | 7237 | int arr[5] = {1, 2, 3, 4, 5}; |
|
0 commit comments