[PATCH] D147924: [clang-tidy] Exclude template instantiations in modernize-use-override

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 15 01:34:03 PDT 2023


carlosgalvezp added a comment.

Looks good, some small comments.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/use-override-templates.cpp:15
+  virtual void foo();
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:16: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
+  // CHECK-FIXES-NOT: {{^}}  void foo() override;{{$}}
----------------
I think it's a bit more readable to write a normal comment explaining that these functions should not trigger a warning. Since you have a least one positive CHECK-MESSAGES below then the check should no longer complain that there aren't any.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/use-override-templates.cpp:16
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:16: warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override]
+  // CHECK-FIXES-NOT: {{^}}  void foo() override;{{$}}
+  virtual void foo2();
----------------
I believe I saw a review comment in another patch that these are not needed?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147924/new/

https://reviews.llvm.org/D147924



More information about the cfe-commits mailing list