.. title:: clang-tidy - bugprone-parent-virtual-call

bugprone-parent-virtual-call
============================

Detects and fixes calls to grand-...parent virtual methods instead of calls
to overridden parent's virtual methods.

.. code-block:: c++

  class A {
    int virtual foo() {...}
  };

  class B: public A {
    int foo() override {...}
  };

  class C: public B {
    int foo() override { A::foo(); }
  //                     ^^^^^^^^
  // warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'?  [bugprone-parent-virtual-call]
  };

.. title:: clang-tidy - bugprone-parent-virtual-call

bugprone-parent-virtual-call
============================

Detects and fixes calls to grand-...parent virtual methods instead of calls
to overridden parent's virtual methods.

.. code-block:: c++

  struct A {
    int virtual foo() {...}
  };

  struct B: public A {
    int foo() override {...}
  };

  struct C: public B {
    int foo() override { A::foo(); }
  //                     ^^^^^^^^
  // warning: qualified name A::foo refers to a member overridden in subclass; did you mean 'B'?  [bugprone-parent-virtual-call]
  };

Replace 'class' with 'struct' for 'public' by default
[doc] Replace 'class' with 'struct' for 'public' by default

Make sample syntax correct.



git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@351867 91177308-0d34-0410-b5e6-96231b3b80d8
