Remove 'IgnoreDestructors = true' from cppcoreguidelines-explicit-virtual-functions

This requirement was introduced in the C++ Core guidelines in 2016:

1894380d0a

Then clang-tidy got updated to comply with the rule.

However in 2019 this decision was reverted:

5fdfb20b76

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.
This commit is contained in:
Carlos Galvez 2021-10-12 10:05:43 -04:00 committed by Aaron Ballman
parent 564e082d09
commit 40546cb381
3 changed files with 6 additions and 5 deletions

View File

@ -106,9 +106,6 @@ public:
Opts["cppcoreguidelines-non-private-member-variables-in-classes."
"IgnoreClassesWithAllMemberVariablesBeingPublic"] = "true";
Opts["cppcoreguidelines-explicit-virtual-functions."
"IgnoreDestructors"] = "true";
return Options;
}
};

View File

@ -113,6 +113,10 @@ New check aliases
Changes in existing checks
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Removed default setting `cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors = "true"`,
to match the current state of the C++ Core Guidelines.
Removed checks
^^^^^^^^^^^^^^

View File

@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s modernize-use-override %t -- -- -fexceptions
// RUN: %check_clang_tidy %s modernize-use-override,cppcoreguidelines-explicit-virtual-functions %t -- -- -fexceptions
#define ABSTRACT = 0
@ -52,7 +52,7 @@ struct Base {
struct SimpleCases : public Base {
public:
virtual ~SimpleCases();
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual'
// CHECK-FIXES: {{^}} ~SimpleCases() override;
void a();