|
2126 | 2126 | defined for the purposes of \ref{over}; the actual initialization is
|
2127 | 2127 | defined in terms of constructors and is not a conversion.
|
2128 | 2128 | \end{note}
|
2129 |
| -Any difference in top-level cv-qualification is |
2130 |
| -subsumed by the initialization itself and does not constitute a conversion. |
2131 |
| -\begin{example} |
2132 |
| -A parameter of type |
2133 |
| -\tcode{A} |
2134 |
| -can be initialized from an argument of type |
2135 |
| -\tcode{const A}. |
2136 |
| -The implicit conversion sequence for that case is the identity sequence; it |
2137 |
| -contains no ``conversion'' from |
2138 |
| -\tcode{const A} |
2139 |
| -to |
2140 |
| -\tcode{A}. |
2141 |
| -\end{example} |
2142 | 2129 |
|
2143 | 2130 | \pnum
|
2144 |
| -When the parameter has a class type and the argument expression has the |
2145 |
| -same type, the implicit conversion sequence is an identity conversion. |
| 2131 | +When the cv-unqualified version of the type of the argument expression |
| 2132 | +is the same as the parameter type, |
| 2133 | +the implicit conversion sequence is an identity conversion. |
2146 | 2134 | When the parameter has a class type and the argument expression has a
|
| 2135 | +(possibly cv-qualified) |
2147 | 2136 | derived class type, the implicit conversion sequence is a
|
2148 | 2137 | derived-to-base
|
2149 | 2138 | \indextext{conversion!derived-to-base}%
|
|
2153 | 2142 | There is no such standard conversion; this derived-to-base conversion exists
|
2154 | 2143 | only in the description of implicit conversion sequences.
|
2155 | 2144 | \end{note}
|
| 2145 | +\begin{example} |
| 2146 | +An implicit conversion sequence from an argument of type \tcode{const A} |
| 2147 | +to a parameter of type \tcode{A} can be formed, |
| 2148 | +even if overload resolution for copy-initialization of \tcode{A} |
| 2149 | +from the argument would not find a viable function\iref{over.match.ctor,over.match.viable}. |
| 2150 | +The implicit conversion sequence for that case is the identity sequence; it |
| 2151 | +contains no ``conversion'' from \tcode{const A} to \tcode{A}. |
| 2152 | +\end{example} |
2156 | 2153 |
|
2157 | 2154 | \pnum
|
2158 | 2155 | When the parameter is the implicit object parameter of a static member function,
|
|
0 commit comments