diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-08-12 14:35:13 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-08-12 14:35:13 +0000 |
commit | bc8f5ac7541c863f83b53ed819292d79882ffe67 (patch) | |
tree | fec4d85effc5fbac5bb39cbedbdf7fc284dbfb5a /clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | |
parent | bae6aab6fbe9fb655dd0f87d5075f4fc25d96491 (diff) | |
download | bcm5719-llvm-bc8f5ac7541c863f83b53ed819292d79882ffe67.tar.gz bcm5719-llvm-bc8f5ac7541c863f83b53ed819292d79882ffe67.zip |
Add a new check to the readability module that flags uses of "magic numbers" (both floating-point and integral).
Patch by Florin Iucha <florin@signbit.net>
llvm-svn: 339516
Diffstat (limited to 'clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp index a0392594696..69ecd0c46c2 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp @@ -11,6 +11,7 @@ #include "../ClangTidyModule.h" #include "../ClangTidyModuleRegistry.h" #include "../misc/UnconventionalAssignOperatorCheck.h" +#include "../readability/MagicNumbersCheck.h" #include "AvoidGotoCheck.h" #include "InterfacesGlobalInitCheck.h" #include "NarrowingConversionsCheck.h" @@ -41,6 +42,8 @@ public: "cppcoreguidelines-avoid-goto"); CheckFactories.registerCheck<InterfacesGlobalInitCheck>( "cppcoreguidelines-interfaces-global-init"); + CheckFactories.registerCheck<readability::MagicNumbersCheck>( + "cppcoreguidelines-avoid-magic-numbers"); CheckFactories.registerCheck<NarrowingConversionsCheck>( "cppcoreguidelines-narrowing-conversions"); CheckFactories.registerCheck<NoMallocCheck>("cppcoreguidelines-no-malloc"); |