Skip to content

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

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

Open
wants to merge 1 commit 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 @@ -4897,20 +4897,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 designating class of the right operand.
\begin{note}
This requirement is in addition to the requirement that
the member be accessible as designated.
\end{note}

\rSec2[class.friend]{Friends}%
\indextext{friend function!access and}%
\indextext{access control!friend function}
Expand Down
10 changes: 10 additions & 0 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4338,6 +4338,16 @@
Otherwise, the program is ill-formed.
\end{itemize}

\pnum
Let \tcode{C} be the cv-unqualified version of the type of \tcode{E1}.
The program is ill-formed if a prvalue of type ``pointer to \tcode{C}''
cannot be implicitly converted to a pointer to
the designating class\iref{class.access.base} of the right operand.
\begin{note}
This requirement is in addition to the requirement that
the member be accessible as designated.
\end{note}

\pnum
If \tcode{E2} designates a non-static member
(possibly after overload resolution),
Expand Down