Skip to content

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

@oni-link

Description

@oni-link

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*
  ...
}

Metadata

Metadata

Assignees

Labels

tinyAn issue with a small change; with "cwg" label: can be applied editorially after CWG consent.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions