Skip to content

Commit

Permalink
[clang-tidy][docs][NFC] Refer to the CERT rule in bugprone-shared-ptr…
Browse files Browse the repository at this point in the history
…-array-mismatch docs

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

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121214
  • Loading branch information
Balazs Benics committed Mar 13, 2022
1 parent d2baefa commit 200e7a8
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -29,3 +29,8 @@ Example:
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 partially covers 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>`_
However, only the ``std::shared_ptr`` case is detected by this check.

0 comments on commit 200e7a8

Please sign in to comment.