[PATCH] D33470: [clang-tidy] Add misc-default-numerics

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 13:51:38 PDT 2017


aaron.ballman added a comment.

Once you fix the typo in the check, can you run it over some large C++ code bases to see if it finds any results?



================
Comment at: clang-tidy/misc/DefaultNumericsCheck.cpp:30
+              ofClass(classTemplateSpecializationDecl(
+                  hasName("::std::numeric_limit"),
+                  unless(isExplicitTemplateSpecialization()),
----------------
This should be checking for `::std::numeric_limits` (plural).


================
Comment at: docs/ReleaseNotes.rst:77
+  <http://clang.llvm.org/extra/clang-tidy/checks/misc-default-numerics.html>`_ check
+  Finds uses of ``std::numeric_limit<T>`` for unspecialized types
+
----------------
numeric_limits


================
Comment at: test/clang-tidy/misc-default-numerics.cpp:6
+template <typename T>
+struct numeric_limit {
+  static T min() { return T(); }
----------------
numeric_limits (same elsewhere in this file).


https://reviews.llvm.org/D33470





More information about the cfe-commits mailing list