[PATCH] D58731: [clang-tidy] added cppcoreguidelines-explicit-virtual-functions

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 14:24:14 PST 2019


alexfh added a comment.

Thank you for the contribution! Please see the comments inline.



================
Comment at: clang-tidy/modernize/UseOverrideCheck.cpp:22
   // Only register the matcher for C++11.
-  if (getLangOpts().CPlusPlus11)
-    Finder->addMatcher(cxxMethodDecl(isOverride()).bind("method"), this);
+  if (getLangOpts().CPlusPlus11) {
+    if (IgnoreDestructors)
----------------
Please prefer early exit:
```
if (!getLangOpts().CPlusPlus11)
  return;
<everything else>
```


================
Comment at: docs/ReleaseNotes.rst:71
+- New :doc:`cppcoreguidelines-explicit-virtual-functions
+  <clang-tidy/checks/cppcoreguidelines-explicit-virtual-functions>` check.
+
----------------
1. Please mention that this is an alias for the modernize-use-override check.
2. Please add a document for the new alias. See docs/clang-tidy/checks/cppcoreguidelines-avoid-c-arrays.rst for an example.


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

https://reviews.llvm.org/D58731





More information about the cfe-commits mailing list