Skip to content

Commit 523377a

Browse files
committed
CWG233 References vs pointers in UDC overload resolution
[over.ics.rank] Fix punctuation in bullet 3.2.5.
1 parent 6d67d20 commit 523377a

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

source/overloading.tex

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,10 +1734,10 @@
17341734
(see~\ref{dcl.init},
17351735
\ref{over.match.conv}, and~\ref{over.match.ref})
17361736
and the standard conversion sequence
1737-
from the return type of $\tcode{F}_1$ to the destination type
1737+
from the result of $\tcode{F}_1$ to the destination type
17381738
(i.e., the type of the entity being initialized)
17391739
is a better conversion sequence than the standard conversion sequence
1740-
from the return type of $\tcode{F}_2$ to the destination type
1740+
from the result of $\tcode{F}_2$ to the destination type
17411741
\begin{example}
17421742
\begin{codeblock}
17431743
struct A {
@@ -2792,7 +2792,7 @@
27922792
(where a standard conversion sequence that is a reference binding
27932793
is considered to yield the cv-unqualified referenced type),
27942794
where \tcode{T1} and \tcode{T2} are not the same type, and
2795-
\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref}.
2795+
\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref}
27962796
\begin{example}
27972797
\begin{codeblock}
27982798
int f(const volatile int *);
@@ -2806,14 +2806,15 @@
28062806
\end{codeblock}
28072807
\end{example}
28082808
or, if not that,
2809+
28092810
\item
28102811
\tcode{S1}
28112812
and
28122813
\tcode{S2}
28132814
bind ``reference to \tcode{T1}'' and ``reference to \tcode{T2}'',
28142815
respectively\iref{dcl.init.ref},
28152816
where \tcode{T1} and \tcode{T2} are not the same type, and
2816-
\tcode{T2} is reference-compatible with \tcode{T1}.
2817+
\tcode{T2} is reference-compatible with \tcode{T1}
28172818
\begin{example}
28182819
\begin{codeblock}
28192820
int f(const int &);
@@ -2846,6 +2847,32 @@
28462847
}
28472848
\end{codeblock}
28482849
\end{example}
2850+
or, if not that,
2851+
2852+
\item
2853+
\tcode{S1} and \tcode{S2}
2854+
bind the same reference type ``reference to \tcode{T}'' and
2855+
have source types \tcode{V1} and \tcode{V2}, respectively,
2856+
where the standard conversion sequence from \tcode{V1*} to \tcode{T*}
2857+
is better than the standard conversion sequence from \tcode{V2*} to \tcode{T*}.
2858+
\begin{example}
2859+
\begin{codeblock}
2860+
struct Z {};
2861+
2862+
struct A {
2863+
operator Z&();
2864+
operator const Z&(); // \#1
2865+
};
2866+
2867+
struct B {
2868+
operator Z();
2869+
operator const Z&&(); // \#2
2870+
};
2871+
2872+
const Z& r1 = A(); // OK, uses \#1
2873+
const Z&& r2 = B(); // OK, uses \#2
2874+
\end{codeblock}
2875+
\end{example}
28492876
\end{itemize}
28502877

28512878
\item

0 commit comments

Comments
 (0)