[PATCH] D111041: [clang-tidy] Remove 'IgnoreDestructors = true' from cppcoreguidelines-explicit-virtual-functions
Carlos Galvez via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 12 01:19:33 PDT 2021
carlosgalvezp added inline comments.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-override.cpp:56
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;
----------------
aaron.ballman wrote:
> 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:
> ```
> // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
> // CHECK-CPPCOREGUIDELINES-NOT: :[[@LINE-2]]:11: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual'
> ```
> 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).
Not sure I follow. What you propose is something that would make sense _before_ this patch, when the `cppcoreguidelines` check was _different_ than `modernize`. But now they are not, they are identical, so we expect to get identical diagnostics from them. Or am I missing something obvious?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111041/new/
https://reviews.llvm.org/D111041
More information about the llvm-commits
mailing list