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/docs/clang-tidy | |
parent | 4a7436fd82063de5e4cad83da0a9cfc1f77711b6 (diff) | |
download | bcm5719-llvm-de34985caae79ce7d125cd55fa634e74aa04427d.tar.gz bcm5719-llvm-de34985caae79ce7d125cd55fa634e74aa04427d.zip |
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/docs/clang-tidy')
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/list.rst | 1 | ||||
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index 600b09d9273..331edc479de 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -30,6 +30,7 @@ List of clang-tidy Checks misc-macro-parentheses misc-macro-repeated-side-effects misc-move-constructor-init + misc-new-delete-overloads misc-noexcept-move-constructor misc-sizeof-container misc-static-assert diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst new file mode 100644 index 00000000000..381371881ea --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst @@ -0,0 +1,14 @@ +misc-new-delete-overloads +========================= + +The check flags overloaded operator new() and operator delete() functions that +do not have a corresponding free store function defined within the same scope. +For instance, the check will flag a class implementation of a non-placement +operator new() when the class does not also define a non-placement operator +delete() function as well. + +The check does not flag implicitly-defined operators, deleted or private +operators, or placement operators. + +This check corresponds to CERT C++ Coding Standard rule `DCL54-CPP. Overload allocation and deallocation functions as a pair in the same scope +<https://www.securecoding.cert.org/confluence/display/cplusplus/DCL54-CPP.+Overload+allocation+and+deallocation+functions+as+a+pair+in+the+same+scope>`_. |