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.


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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to