Skip to content

Commit 5f23dff

Browse files
committed
Sync documentation to release notes
on-behalf-of: @amd <[email protected]>
1 parent 176d195 commit 5f23dff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/default-lambda-capture.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
bugprone-default-lambda-capture
44
===============================
55

6-
Warns when lambda expressions use default capture modes (``[=]`` or ``[&]``)
7-
instead of explicitly capturing specific variables. Default captures can make
8-
code less readable and more error-prone by making it unclear which variables
9-
are being captured and how.
6+
Finds lambda expressions that use default capture modes (``[=]`` or ``[&]``)
7+
and suggests using explicit captures instead. Default captures can lead to
8+
subtle bugs including dangling references with ``[&]``, unnecessary copies
9+
with ``[=]``, and make code less maintainable by hiding which variables are
10+
actually being captured.
1011

1112
Implements Item 31 of Effective Modern C++ by Scott Meyers.
1213

0 commit comments

Comments
 (0)