Skip to content

Commit 7cb9798

Browse files
burblebeetkoeppe
authored andcommitted
CWG2801 Reference binding with reference-related types
1 parent 55016c2 commit 7cb9798

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

source/declarations.tex

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5670,11 +5670,10 @@
56705670
\end{example}
56715671

56725672
\item
5673-
Otherwise:
5673+
Otherwise, \tcode{T1} shall not be reference-related to \tcode{T2}.
56745674
\begin{itemize}
56755675
\item
5676-
If \tcode{T1} or \tcode{T2} is a class type and
5677-
\tcode{T1} is not reference-related to \tcode{T2},
5676+
If \tcode{T1} or \tcode{T2} is a class type,
56785677
user-defined conversions are considered
56795678
using the rules for copy-initialization of an object of type
56805679
``\cvqual{cv1} \tcode{T1}'' by
@@ -5693,24 +5692,6 @@
56935692
and the reference is bound to the result.
56945693
\end{itemize}
56955694

5696-
If
5697-
\tcode{T1}
5698-
is reference-related to
5699-
\tcode{T2}:
5700-
\begin{itemize}
5701-
\item
5702-
\cvqual{cv1}
5703-
shall be the same cv-qualification as, or greater cv-qualification than,
5704-
\cvqual{cv2}; and
5705-
\item
5706-
if the reference is an rvalue reference,
5707-
the initializer expression shall not be an lvalue.
5708-
\begin{note}
5709-
This can be affected by
5710-
whether the initializer expression is move-eligible\iref{expr.prim.id.unqual}.
5711-
\end{note}
5712-
\end{itemize}
5713-
57145695
\begin{example}
57155696
\begin{codeblock}
57165697
struct Banana { };

0 commit comments

Comments
 (0)