[clang] [clang][analyzer] Bring cplusplus.ArrayDelete out of alpha (PR #83985)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 07:52:00 PDT 2024


================
@@ -340,6 +340,50 @@ cplusplus
 
 C++ Checkers.
 
+.. _cplusplus-ArrayDelete:
+
+cplusplus.ArrayDelete (C++)
+"""""""""""""""""""""""""""
+Reports destructions of arrays of polymorphic objects that are destructed as
+their base class. If the dynamic type of the array's object is different from
+its static type, calling `delete[]` is undefined.
+
+This checker corresponds to the CERT rule `EXP51-CPP: Do not delete an array through a pointer of the incorrect type <https://wiki.sei.cmu.edu/confluence/display/cplusplus/EXP51-CPP.+Do+not+delete+an+array+through+a+pointer+of+the+incorrect+type>`_.
----------------
whisperity wrote:

```suggestion
This checker corresponds to the SEI CERT rule `EXP51-CPP: Do not delete an array through a pointer of the incorrect type <https://wiki.sei.cmu.edu/confluence/display/cplusplus/EXP51-CPP.+Do+not+delete+an+array+through+a+pointer+of+the+incorrect+type>`_.
```

Style nit, to toe the line.

https://github.com/llvm/llvm-project/pull/83985


More information about the cfe-commits mailing list