diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-09-29 13:12:21 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-09-29 13:12:21 +0000 |
commit | de34985caae79ce7d125cd55fa634e74aa04427d (patch) | |
tree | 5741ab14b526f6f51be6cc15ed32518c29305563 /clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | |
parent | 4a7436fd82063de5e4cad83da0a9cfc1f77711b6 (diff) | |
download | llvm-de34985caae79ce7d125cd55fa634e74aa04427d.zip llvm-de34985caae79ce7d125cd55fa634e74aa04427d.tar.gz llvm-de34985caae79ce7d125cd55fa634e74aa04427d.tar.bz2 |
Adding a checker (misc-new-delete-overloads) that detects mismatched overloads of operator new and operator delete. Corresponds to the CERT C++ secure coding rule: https://www.securecoding.cert.org/confluence/display/cplusplus/DCL54-CPP.+Overload+allocation+and+deallocation+functions+as+a+pair+in+the+same+scope
llvm-svn: 248791
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp index dc9a4eb..636deb2 100644 --- a/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp @@ -19,6 +19,7 @@ #include "MacroParenthesesCheck.h" #include "MacroRepeatedSideEffectsCheck.h" #include "MoveConstructorInitCheck.h" +#include "NewDeleteOverloadsCheck.h" #include "NoexceptMoveConstructorCheck.h" #include "SizeofContainerCheck.h" #include "StaticAssertCheck.h" @@ -53,6 +54,8 @@ public: "misc-macro-repeated-side-effects"); CheckFactories.registerCheck<MoveConstructorInitCheck>( "misc-move-constructor-init"); + CheckFactories.registerCheck<NewDeleteOverloadsCheck>( + "misc-new-delete-overloads"); CheckFactories.registerCheck<NoexceptMoveConstructorCheck>( "misc-noexcept-move-constructor"); CheckFactories.registerCheck<SizeofContainerCheck>( |