Skip to content

Commit 40546cb

Browse files
carlosgalvezpAaronBallman
authored andcommitted
Remove 'IgnoreDestructors = true' from cppcoreguidelines-explicit-virtual-functions
This requirement was introduced in the C++ Core guidelines in 2016: isocpp/CppCoreGuidelines@1894380 Then clang-tidy got updated to comply with the rule. However in 2019 this decision was reverted: isocpp/CppCoreGuidelines@5fdfb20 Therefore we need to apply the correct configuration to clang-tidy again. This also makes this cppcoreguidelines check consistent with the other 2 alias checks: hicpp-use-override and modernize-use-override. Additionally, add another RUN line to the unit test, to make sure cppcoreguidelines-explicit-virtual-functions is tested.
1 parent 564e082 commit 40546cb

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ class CppCoreGuidelinesModule : public ClangTidyModule {
106106
Opts["cppcoreguidelines-non-private-member-variables-in-classes."
107107
"IgnoreClassesWithAllMemberVariablesBeingPublic"] = "true";
108108

109-
Opts["cppcoreguidelines-explicit-virtual-functions."
110-
"IgnoreDestructors"] = "true";
111-
112109
return Options;
113110
}
114111
};

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ New check aliases
113113
Changes in existing checks
114114
^^^^^^^^^^^^^^^^^^^^^^^^^^
115115

116+
- Removed default setting `cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors = "true"`,
117+
to match the current state of the C++ Core Guidelines.
118+
119+
116120
Removed checks
117121
^^^^^^^^^^^^^^
118122

clang-tools-extra/test/clang-tidy/checkers/modernize-use-override.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fexceptions
1+
// RUN: %check_clang_tidy %s modernize-use-override,cppcoreguidelines-explicit-virtual-functions %t -- -- -fexceptions
22

33
#define ABSTRACT = 0
44

@@ -52,7 +52,7 @@ struct Base {
5252
struct SimpleCases : public Base {
5353
public:
5454
virtual ~SimpleCases();
55-
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
55+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual'
5656
// CHECK-FIXES: {{^}} ~SimpleCases() override;
5757

5858
void a();

0 commit comments

Comments
 (0)