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

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 7 08:08:30 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 5685def507ed7c95bf93572e5cf8c30efbc7d99b 8f49378e77a8b248f34d689996835629c279d7c6 --extensions cpp,h -- clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.cpp clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.h clang-tools-extra/test/clang-tidy/checkers/bugprone/capture-this-by-field.cpp clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.h b/clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.h
index 72c0a540a7..0329614ad2 100644
--- a/clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/CaptureThisByFieldCheck.h
@@ -15,8 +15,9 @@
 
 namespace clang::tidy::bugprone {
 
-/// Finds lambda captures that capture the ``this`` pointer and store it as class
-/// members without handle the copy and move constructors and the assignments.
+/// Finds lambda captures that capture the ``this`` pointer and store it as
+/// class members without handle the copy and move constructors and the
+/// assignments.
 ///
 /// For the user-facing documentation see:
 /// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/capture-this-by-field.html

``````````

</details>


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


More information about the cfe-commits mailing list