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
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
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;
~
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.
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
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
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