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

2018-11-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Ok, Thank you for looking into it. You can abondon the revision in phabricator (Selection above comment field at the bottom of the page) if you wish. Am 19.11.18 um 23:36 schrieb Mateusz Maćkowski via Phabricator: > m4tx added a comment. > > After thinking about the p

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

2018-11-19 Thread Mateusz Maćkowski via Phabricator via cfe-commits
m4tx added a comment. After thinking about the possible use cases (and the difficulty of implementing heuristics for them) as well as fiddling with Clang Static Analyzer it seems that this patch can be discarded as the Analyzer already handles `delete this` pretty well. I've posted an update to

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

2018-11-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/bugprone/DeleteThisCheck.cpp:23 + cxxDeleteExpr( + has(ignoringParenImpCasts(cxxThisExpr( + .bind("DeleteThis"), Will this catch too much? e.g., ``` struct S { int *Foo; ~

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

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please also add regression test case. Is should also cover standalone function with this variable. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54262 ___ cfe-commits mailing list cfe-commits@lists.

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

2018-11-08 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please mention this check in docs/ReleaseNotes.rst (in alphabetical order). Comment at: docs/clang-tidy/checks/bugprone-delete-this.rst:8 + +Said statement generates multiple problems, such as enforcing allocating the object via ``new``, or not

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

2018-11-08 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. It's best to use `clang-tidy/add_new_check.py` tool. You also need tests, and a note in releasenotes. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D54262 ___ cfe-commits mailing list cfe-commits@lists.ll

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

2018-11-08 Thread Mateusz Maćkowski via Phabricator via cfe-commits
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 gua