Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[class.access.base] No cv-qualification for access to inherited members #5068

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4760,20 +4760,6 @@
\end{example}
\end{itemize}

\pnum
If a class member access operator, including an implicit
``\tcode{this->}'',
is used to access a non-static data member or non-static
member function, the reference is ill-formed if the
left operand (considered as a pointer in the
``\tcode{.}''
operator case) cannot be implicitly converted to a
pointer to the naming class of the right operand.
\begin{note}
This requirement is in addition to the requirement that
the member be accessible as named.
\end{note}

\rSec2[class.friend]{Friends}%
\indextext{friend function!access and}%
\indextext{access control!friend function}
Expand Down
14 changes: 12 additions & 2 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3636,14 +3636,24 @@
whose value is the value of the enumerator.
\end{itemize}

\pnum
If \tcode{E1} is of type \cv~\tcode{D} and the naming
class\iref{class.access.base} of \tcode{E2} is \cv~\tcode{B}, the program is
ill-formed if a prvalue of type ``pointer to \tcode{D}'' cannot be
implicitly converted to ``pointer to \tcode{B}''.
\begin{note}
This requirement is in addition to the requirement that
the member be accessible as named.
\end{note}

\pnum
If \tcode{E2} is a non-static member,
the program is ill-formed if the class of which \tcode{E2} is
directly a member is an ambiguous base\iref{class.member.lookup} of
the naming class\iref{class.access.base} of \tcode{E2}.
the naming class of \tcode{E2}.
\begin{note}
The program is also ill-formed if the naming class is an ambiguous base of the class type
of the object expression; see~\ref{class.access.base}.
of the object expression.
\end{note}

\pnum
Expand Down