This requirement was introduced in the C++ Core guidelines in 2016:
https://github.com/isocpp/CppCoreGuidelines/commit/1894380d0abf4d7d49a983005647e0d41ecbf214
Then clang-tidy got updated to comply with the rule.
However in 2019 this decision was reverted:
https://github.com/isocpp/CppCoreGuidelines/commit/5fdfb20b760c5307bf86873798a146fcd7e912e6
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 isn't quite what I was after; now it looks like we expect to always get the diagnostic (in fact, I'm a bit worried that this test is passing). I'd rather see:
So that we check explicitly we see the diagnostic for modernize and explicitly that we don't see the diagnostic for C++ Core Guidelines.
You'll need to change the second RUN line to not use check_clang_tidy but instead execute clang-tidy manually so you can pass -check-prefix=CHECK-CPPCOREGUIDELINES to it (as done in https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/test/clang-tidy/checkers/cert-static-object-exception.cpp#L4).