Skip to content

Commit 31366e6

Browse files
committed
Fix doc and release notes
on-behalf-of: @amd <[email protected]>
1 parent 330dbd8 commit 31366e6

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ New checks
167167
Detects default initialization (to 0) of variables with ``enum`` type where
168168
the enum has no enumerator with value of 0.
169169

170+
- New :doc:`bugprone-default-lambda-capture
171+
<clang-tidy/checks/bugprone/default-lambda-capture>` check.
172+
173+
Warns on default lambda captures (e.g. ``[&](){ ... }``, ``[=](){ ... }``)
174+
170175
- New :doc:`bugprone-derived-method-shadowing-base-method
171176
<clang-tidy/checks/bugprone/derived-method-shadowing-base-method>` check.
172177

@@ -203,15 +208,6 @@ New checks
203208
Finds virtual function overrides with different visibility than the function
204209
in the base class.
205210

206-
- New :doc:`bugprone-default-lambda-capture
207-
<clang-tidy/checks/bugprone/default-lambda-capture>` check.
208-
209-
Finds lambda expressions that use default capture modes (``[=]`` or ``[&]``)
210-
and suggests using explicit captures instead. Default captures can lead to
211-
subtle bugs including dangling references with ``[&]``, unnecessary copies
212-
with ``[=]``, and make code less maintainable by hiding which variables are
213-
actually being captured.
214-
215211
New check aliases
216212
^^^^^^^^^^^^^^^^^
217213

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

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

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.
6+
Warns on default lambda captures (e.g. ``[&](){ ... }``, ``[=](){ ... }``)
7+
8+
Default captures can lead to subtle bugs including dangling references with
9+
``[&]``, unnecessary copies with ``[=]``, and make code less maintainable by
10+
hiding which variables are actually being captured.
1111

1212
Implements Item 31 of Effective Modern C++ by Scott Meyers.
1313

0 commit comments

Comments
 (0)