[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 07:00:50 PDT 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.

LGTM aside from a minor issue.



================
Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewAlignmentCheck.cpp:30-31
+  // Check not applicable in C++17 or newer.
+  if (getLangOpts().CPlusPlus17 || getLangOpts().CPlusPlus2a)
+    return;
+
----------------
This should be in the `registerMatchers()` function so that we don't even bother trying to match anything. You don't need to do the `||` either; if 2a is enabled, that automatically enables all previous modes as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67545





More information about the cfe-commits mailing list