llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability/delete-null-pointer.rst
raw| 1 | .. title:: clang-tidy - readability-delete-null-pointer |
| 2 | |
| 3 | readability-delete-null-pointer |
| 4 | =============================== |
| 5 | |
| 6 | Checks the ``if`` statements where a pointer's existence is checked and then deletes the pointer. |
| 7 | The check is unnecessary as deleting a null pointer has no effect. |
| 8 | |
| 9 | .. code:: c++ |
| 10 | |
| 11 | int *p; |
| 12 | if (p) |
| 13 | delete p; |