|
4049 | 4049 | An lvalue of type ``\cvqual{cv1} \tcode{B}'', where \tcode{B} is a class
|
4050 | 4050 | type, can be cast to type ``reference to \cvqual{cv2} \tcode{D}'', where
|
4051 | 4051 | \tcode{D} is a complete class derived\iref{class.derived} from \tcode{B},
|
4052 |
| -if \cvqual{cv2} is the |
4053 |
| -same cv-qualification as, or greater cv-qualification than, |
4054 |
| -\cvqual{cv1}. If \tcode{B} is a virtual base class of \tcode{D} |
| 4052 | +if \cvqual{cv2}~\tcode{D} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{B}. |
| 4053 | +If \tcode{B} is a virtual base class of \tcode{D} |
4055 | 4054 | or a base class of a virtual base class of \tcode{D},
|
4056 | 4055 | or if no valid standard conversion from ``pointer to \tcode{D}''
|
4057 | 4056 | to ``pointer to \tcode{B}'' exists\iref{conv.ptr}, the program is ill-formed.
|
|
4214 | 4213 | A prvalue of type ``pointer to \cvqual{cv1} \tcode{B}'', where \tcode{B}
|
4215 | 4214 | is a class type, can be converted to a prvalue of type ``pointer to
|
4216 | 4215 | \cvqual{cv2} \tcode{D}'',
|
4217 |
| -where \tcode{D} is a complete class derived\iref{class.derived} |
4218 |
| -from \tcode{B}, |
4219 |
| -if \cvqual{cv2} is the same cv-qualification as, |
4220 |
| -or greater cv-qualification than, \cvqual{cv1}. |
| 4216 | +where \tcode{D} is a complete class derived\iref{class.derived} from \tcode{B}, |
| 4217 | +if \cvqual{cv2}~\tcode{D} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{B}. |
4221 | 4218 | If \tcode{B} is a virtual base class of \tcode{D} or
|
4222 | 4219 | a base class of a virtual base class of \tcode{D}, or
|
4223 | 4220 | if no valid standard conversion from ``pointer to \tcode{D}''
|
|
4236 | 4233 | \tcode{B} of type \cvqual{cv2} \tcode{T}'', where
|
4237 | 4234 | \tcode{D} is a complete class type and
|
4238 | 4235 | \tcode{B} is a base class\iref{class.derived} of \tcode{D},
|
4239 |
| -if \cvqual{cv2} is the same cv-qualification |
4240 |
| -as, or greater cv-qualification than, \cvqual{cv1}. |
| 4236 | +if \cvqual{cv2}~\tcode{T} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{T}. |
4241 | 4237 | \begin{note}
|
4242 | 4238 | Function types (including those used in pointer-to-member-function types)
|
4243 | 4239 | are never cv-qualified\iref{dcl.fct}.
|
|
4261 | 4257 | \pnum
|
4262 | 4258 | A prvalue of type ``pointer to \cvqual{cv1} \keyword{void}'' can be
|
4263 | 4259 | converted to a prvalue of type ``pointer to \cvqual{cv2} \tcode{T}'',
|
4264 |
| -where \tcode{T} is an object type and \cvqual{cv2} is the same |
4265 |
| -cv-qualification as, or greater cv-qualification than, \cvqual{cv1}. |
| 4260 | +where \tcode{T} is an object type, |
| 4261 | +and \cvqual{cv2}~\tcode{T} is equally as or more cv-qualified than \cvqual{cv1}~\tcode{void}. |
4266 | 4262 | If the original pointer value represents the address
|
4267 | 4263 | \tcode{A} of a byte in memory and
|
4268 | 4264 | \tcode{A} does not satisfy the alignment requirement of \tcode{T},
|
|
7038 | 7034 | \begin{itemize}
|
7039 | 7035 | \item if \tcode{T1} and \tcode{T2} are the same class type
|
7040 | 7036 | (ignoring cv-qualification) and
|
7041 |
| -\tcode{T2} is at least as cv-qualified as \tcode{T1}, |
| 7037 | +\tcode{T2} is equally as or more cv-qualified than \tcode{T1}, |
7042 | 7038 | the target type is \tcode{T2},
|
7043 | 7039 |
|
7044 | 7040 | \item otherwise, if \tcode{T2} is a base class of \tcode{T1},
|
|
0 commit comments