[PATCH] D121214: [clang-tidy][docs][NFC] Add alias cert-mem51-cpp to bugprone-shared-ptr-array-mismatch

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 07:12:58 PST 2022


steakhal created this revision.
steakhal added reviewers: whisperity, aaron.ballman.
Herald added subscribers: jeroen.dobbelaere, martong, rnkovacs, xazax.hun.
Herald added a project: All.
steakhal requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Document the connection between this checker and the corresponding CERT rule.


https://reviews.llvm.org/D121214

Files:
  clang-tools-extra/docs/clang-tidy/checks/bugprone-shared-ptr-array-mismatch.rst
  clang-tools-extra/docs/clang-tidy/checks/cert-mem51-cpp.rst
  clang-tools-extra/docs/clang-tidy/checks/list.rst


Index: clang-tools-extra/docs/clang-tidy/checks/list.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -350,6 +350,7 @@
    `cert-exp42-c <cert-exp42-c.html>`_, `bugprone-suspicious-memory-comparison <bugprone-suspicious-memory-comparison.html>`_,
    `cert-fio38-c <cert-fio38-c.html>`_, `misc-non-copyable-objects <misc-non-copyable-objects.html>`_,
    `cert-flp37-c <cert-flp37-c.html>`_, `bugprone-suspicious-memory-comparison <bugprone-suspicious-memory-comparison.html>`_,
+   `cert-mem51-cpp <cert-mem51-cpp.html>`_, `bugprone-shared-ptr-array-mismatch <bugprone-shared-ptr-array-mismatch.html>`_, "Yes"
    `cert-msc30-c <cert-msc30-c.html>`_, `cert-msc50-cpp <cert-msc50-cpp.html>`_,
    `cert-msc32-c <cert-msc32-c.html>`_, `cert-msc51-cpp <cert-msc51-cpp.html>`_,
    `cert-oop11-cpp <cert-oop11-cpp.html>`_, `performance-move-constructor-init <performance-move-constructor-init.html>`_,
Index: clang-tools-extra/docs/clang-tidy/checks/cert-mem51-cpp.rst
===================================================================
--- /dev/null
+++ clang-tools-extra/docs/clang-tidy/checks/cert-mem51-cpp.rst
@@ -0,0 +1,12 @@
+.. title:: clang-tidy - cert-mem51-cpp
+.. meta::
+   :http-equiv=refresh: 5;URL=bugprone-shared-ptr-array-mismatch.html
+
+cert-mem51-cpp
+==============
+
+The cert-mem51-cpp check is an alias, please see
+`bugprone-shared-ptr-array-mismatch <bugprone-shared-ptr-array-mismatch.html>`_
+for more information.
+
+Please note that the check only partially covers the corresponding CERT rule.
Index: clang-tools-extra/docs/clang-tidy/checks/bugprone-shared-ptr-array-mismatch.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/bugprone-shared-ptr-array-mismatch.rst
+++ clang-tools-extra/docs/clang-tidy/checks/bugprone-shared-ptr-array-mismatch.rst
@@ -29,3 +29,8 @@
     std::shared_ptr<Foo> x(new Foo[10]); // no replacement in this case
     //                     ^ warning: shared pointer to non-array is initialized with array [bugprone-shared-ptr-array-mismatch]
   };
+
+This check corresponds to the CERT C++ Coding Standard rule
+`MEM51-CPP. Properly deallocate dynamically allocated resources
+<https://wiki.sei.cmu.edu/confluence/display/cplusplus/MEM51-CPP.+Properly+deallocate+dynamically+allocated+resources>`_
+rule, but only partially implements it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121214.413794.patch
Type: text/x-patch
Size: 2497 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220308/f6eb5378/attachment.bin>


More information about the cfe-commits mailing list