Skip to content

Commit d315b8b

Browse files
[expr.ref] [class.access.base] Move the requirements
1 parent 3dc8068 commit d315b8b

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

source/classes.tex

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4760,20 +4760,6 @@
47604760
\end{example}
47614761
\end{itemize}
47624762

4763-
\pnum
4764-
If a class member access operator, including an implicit
4765-
``\tcode{this->}'',
4766-
is used to access a non-static data member or non-static
4767-
member function, the reference is ill-formed if the
4768-
left operand is of type ``pointer to \cv{}~\tcode{D}'' (or \cv{}~\tcode{D}
4769-
in the ``\tcode{.}'' operator case), the naming class of the right operand is
4770-
\cv{}~\tcode{B}, and a prvalue of type ``pointer to \tcode{D}'' cannot be
4771-
implicitly converted to ``pointer to \tcode{B}''.
4772-
\begin{note}
4773-
This requirement is in addition to the requirement that
4774-
the member be accessible as named.
4775-
\end{note}
4776-
47774763
\rSec2[class.friend]{Friends}%
47784764
\indextext{friend function!access and}%
47794765
\indextext{access control!friend function}

source/expressions.tex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,14 +3636,24 @@
36363636
whose value is the value of the enumerator.
36373637
\end{itemize}
36383638

3639+
\pnum
3640+
If \tcode{E1} is of type \cv~\tcode{D} and the naming
3641+
class\iref{class.access.base} of \tcode{E2} is \cv~\tcode{B}, the program is
3642+
ill-formed if a prvalue of type ``pointer to \tcode{D}'' cannot be
3643+
implicitly converted to ``pointer to \tcode{B}''.
3644+
\begin{note}
3645+
This requirement is in addition to the requirement that
3646+
the member be accessible as named.
3647+
\end{note}
3648+
36393649
\pnum
36403650
If \tcode{E2} is a non-static member,
36413651
the program is ill-formed if the class of which \tcode{E2} is
36423652
directly a member is an ambiguous base\iref{class.member.lookup} of
3643-
the naming class\iref{class.access.base} of \tcode{E2}.
3653+
the naming class of \tcode{E2}.
36443654
\begin{note}
36453655
The program is also ill-formed if the naming class is an ambiguous base of the class type
3646-
of the object expression; see~\ref{class.access.base}.
3656+
of the object expression.
36473657
\end{note}
36483658

36493659
\pnum

0 commit comments

Comments
 (0)