-
Notifications
You must be signed in to change notification settings - Fork 778
[class.access] Eliminate the friend case for protected member access from derived class #3672
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4472,8 +4472,8 @@ | |
\indextext{access control!\idxcode{protected}}% | ||
protected; | ||
that is, its name can be used only by members and friends | ||
of the class in which it is declared, by classes derived from that class, and by their | ||
friends (see~\ref{class.protected}). | ||
of the class in which it is declared, and members of classes derived from that class | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more concern here: We change "by classes" to "by members of classes". This change seems to exclude the base-specifier, which is not in a member. Example: struct B { }; I think the injected-class-name B is protected in D1, thus accessible from D2. But the name doesn't appear in a member. That said, this paragraph is just one of those intro sentences where the actual rules appear later. (Note the funny punctuation, btw.) So, we shouldn't say wrong things, but we don't need to be ultra-precise either. |
||
(see~\ref{class.protected}). | ||
\item | ||
\indextext{access control!\idxcode{public}}% | ||
public; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"... and by members of classes derived..." (add "by" to keep the sentence structure manageable)