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.virtual] Incorrect comments in [class.virtual] p.9 #1740

Closed
oni-link opened this issue Sep 8, 2017 · 1 comment
Closed

[class.virtual] Incorrect comments in [class.virtual] p.9 #1740

oni-link opened this issue Sep 8, 2017 · 1 comment
Assignees
Labels
tiny An issue with a small change; with "cwg" label: can be applied editorially after CWG consent.
Milestone

Comments

@oni-link
Copy link

oni-link commented Sep 8, 2017

In two comments of function g() in the example for [class.virtual] p.9, a the wrong name Derived::pf() (no member with this name) is used for the called virtual function. The right name should be Derived::vf4():

void g() {
  Derived d;
  Base* bp = &d;                // standard conversion:
                                // Derived* to Base*
  ...
  B*  p = bp->vf4();            // calls Derived​::​pf() and converts the
                                // result to B*
  Derived*  dp = &d;
  D*  q = dp->vf4();            // calls Derived​::​pf() and does not
                                // convert the result to B*
  ...
}
@jensmaurer
Copy link
Member

Agreed.

@jensmaurer jensmaurer self-assigned this Sep 15, 2017
@jensmaurer jensmaurer added this to the C++20 milestone Sep 15, 2017
@jensmaurer jensmaurer added the tiny An issue with a small change; with "cwg" label: can be applied editorially after CWG consent. label Sep 15, 2017
jensmaurer added a commit to jensmaurer/draft that referenced this issue Oct 13, 2017
AaronBallman pushed a commit to AaronBallman/draft that referenced this issue Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tiny An issue with a small change; with "cwg" label: can be applied editorially after CWG consent.
Projects
None yet
Development

No branches or pull requests

2 participants