[PATCH] D54262: [clang-tidy] Add `delete this` bugprone check (PR38741)

Mateusz Maćkowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 8 07:13:14 PST 2018


m4tx created this revision.
m4tx added reviewers: alexfh, hokein.
Herald added subscribers: cfe-commits, xazax.hun, mgorny.

Add a bugprone check to clang-tidy that detects the usages of `delete this`. The warning is shown even when `delete this` is the last line in the method (as there is no guarantee that it won't be called from another method, or the pointer won't be used in any way afterwards).

https://bugs.llvm.org/show_bug.cgi?id=38741


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54262

Files:
  clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tidy/bugprone/CMakeLists.txt
  clang-tidy/bugprone/DeleteThisCheck.cpp
  clang-tidy/bugprone/DeleteThisCheck.h
  docs/clang-tidy/checks/bugprone-delete-this.rst

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54262.173159.patch
Type: text/x-patch
Size: 4684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181108/62012a0f/attachment.bin>


More information about the cfe-commits mailing list