[all-commits] [llvm/llvm-project] f07111: [clang-tidy] Fix false positive in cppcoreguidelin...

Carlos Galvez via All-commits all-commits at lists.llvm.org
Sat Oct 16 01:30:50 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f0711106dc6c14dcaf06437a0467043e983bf9dc
      https://github.com/llvm/llvm-project/commit/f0711106dc6c14dcaf06437a0467043e983bf9dc
  Author: Carlos Galvez <carlosgalvezp at gmail.com>
  Date:   2021-10-16 (Sat, 16 Oct 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-virtual-class-destructor.cpp

  Log Message:
  -----------
  [clang-tidy] Fix false positive in cppcoreguidelines-virtual-class-destructor

Incorrectly triggers for template classes that inherit
from a base class that has virtual destructor.

Any class inheriting from a base that has a virtual destructor
will have their destructor also virtual, as per the Standard:

https://timsong-cpp.github.io/cppwp/n4140/class.dtor#9

> If a class has a base class with a virtual destructor,
> its destructor (whether user- or implicitly-declared) is virtual.

Added unit tests to prevent regression.

Fixes bug https://bugs.llvm.org/show_bug.cgi?id=51912

Differential Revision: https://reviews.llvm.org/D110614




More information about the All-commits mailing list