|
1034 | 1034 | The pointer value\iref{basic.compound} is unchanged by this conversion.
|
1035 | 1035 |
|
1036 | 1036 | \pnum
|
1037 |
| -A prvalue of type ``pointer to \cv{} \tcode{D}'', where \tcode{D} |
| 1037 | +A prvalue \tcode{v} of type ``pointer to \cv{} \tcode{D}'', where \tcode{D} |
1038 | 1038 | is a complete class type, can be converted to a prvalue of type ``pointer to
|
1039 | 1039 | \cv{} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived}
|
1040 | 1040 | of \tcode{D}. If \tcode{B} is an
|
1041 | 1041 | inaccessible\iref{class.access} or
|
1042 | 1042 | ambiguous\iref{class.member.lookup} base class of \tcode{D}, a program
|
1043 |
| -that necessitates this conversion is ill-formed. The result of the |
1044 |
| -conversion is a pointer to the base class subobject of the derived class |
1045 |
| -object. The null pointer value is converted to the null pointer value of |
1046 |
| -the destination type. |
| 1043 | +that necessitates this conversion is ill-formed. |
| 1044 | +If \tcode{v} is a null pointer value, |
| 1045 | +the result is a null pointer value. |
| 1046 | +Otherwise, |
| 1047 | +if \tcode{B} is a virtual base class of \tcode{D} and |
| 1048 | +\tcode{v} does not point to an object |
| 1049 | +whose type is similar\iref{conv.qual} to \tcode{D} and |
| 1050 | +that is |
| 1051 | +within its lifetime or |
| 1052 | +within its period of construction or destruction\iref{class.cdtor}, |
| 1053 | +the behavior is undefined. |
| 1054 | +Otherwise, |
| 1055 | +the result is a pointer to the base class subobject of |
| 1056 | +the derived class object. |
1047 | 1057 |
|
1048 | 1058 | \rSec2[conv.mem]{Pointer-to-member conversions}
|
1049 | 1059 |
|
|
3861 | 3871 | \pnum
|
3862 | 3872 | If \tcode{v} is a null pointer value, the result is a null pointer value.
|
3863 | 3873 |
|
| 3874 | +\pnum |
| 3875 | +If \tcode{v} has type ``pointer to \cv{}~\tcode{U}'' and |
| 3876 | +\tcode{v} does not point to an object |
| 3877 | +whose type is similar\iref{conv.qual} to \tcode{U} and |
| 3878 | +that is |
| 3879 | +within its lifetime or |
| 3880 | +within its period of construction or destruction\iref{class.cdtor}, |
| 3881 | +the behavior is undefined. |
| 3882 | +If \tcode{v} is a glvalue of type \tcode{U} and |
| 3883 | +\tcode{v} does not refer to an object |
| 3884 | +whose type is similar to \tcode{U} and |
| 3885 | +that is |
| 3886 | +within its lifetime or |
| 3887 | +within its period of construction or destruction, |
| 3888 | +the behavior is undefined. |
| 3889 | + |
3864 | 3890 | \pnum
|
3865 | 3891 | If \tcode{T} is ``pointer to \cv{} \keyword{void}'', then the result
|
3866 | 3892 | is a pointer to the most derived object pointed to by \tcode{v}.
|
|
0 commit comments