bolt/deps/llvm-18.1.8/clang-tools-extra/docs/clang-tidy/checks/readability/delete-null-pointer.rst

14 lines
336 B
ReStructuredText
Raw Normal View History

2025-02-14 19:21:04 +01:00
.. title:: clang-tidy - readability-delete-null-pointer
readability-delete-null-pointer
===============================
Checks the ``if`` statements where a pointer's existence is checked and then deletes the pointer.
The check is unnecessary as deleting a null pointer has no effect.
.. code:: c++
int *p;
if (p)
delete p;