[all-commits] [llvm/llvm-project] c58c7a: [clang-tidy] cppcoreguidelines-virtual-base-class-...

Marco Gartmann via All-commits all-commits at lists.llvm.org
Thu Sep 9 04:24:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c58c7a6ea0535a75e382752b37cb68ccea43cde3
      https://github.com/llvm/llvm-project/commit/c58c7a6ea0535a75e382752b37cb68ccea43cde3
  Author: Marco Gartmann <gartmannmarco at hotmail.com>
  Date:   2021-09-09 (Thu, 09 Sep 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt
    M clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp
    A clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.cpp
    A clang-tools-extra/clang-tidy/cppcoreguidelines/VirtualClassDestructorCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    A clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-virtual-class-destructor.cpp

  Log Message:
  -----------
  [clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check

Finds base classes and structs whose destructor is neither public and
virtual nor protected and non-virtual.
A base class's destructor should be specified in one of these ways to
prevent undefined behaviour.

Fixes are available for user-declared and implicit destructors that are
either public and non-virtual or protected and virtual.

This check implements C.35 [1] from the CppCoreGuidelines.

Reviewed By: aaron.ballman, njames93

Differential Revision: http://reviews.llvm.org/D102325

  [1]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-dtor-virtual




More information about the All-commits mailing list