[clang-tools-extra] [clang-tidy] Add new check bugprone-capture-this-by-field (PR #130297)

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 11 18:40:51 PDT 2025


================
@@ -0,0 +1,37 @@
+.. title:: clang-tidy - bugprone-capturing-this-by-field
+
+bugprone-capturing-this-by-field
----------------
HerrCai0907 wrote:

what do you think `bugprone-capturing-this-in-member-variable`. It is longer then field but IMO may be clearer.
I don't like `bugprone-lambda-capturing-this-to-member` because it put lambda capturing and member on the same level of importance. But here we want to highlight the member variable holding `this` is dangerous.

https://github.com/llvm/llvm-project/pull/130297


More information about the cfe-commits mailing list