Skip to content

Commit 0eadc10

Browse files
Apply suggestions from code review
Co-authored-by: Victor Chernyakin <[email protected]>
1 parent 6cefb5f commit 0eadc10

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

clang-tools-extra/clang-tidy/readability/AvoidDefaultLambdaCaptureCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class AvoidDefaultLambdaCaptureCheck : public ClangTidyCheck {
2626
std::optional<TraversalKind> getCheckTraversalKind() const override {
2727
return TK_IgnoreUnlessSpelledInSource;
2828
}
29+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
30+
return LangOpts.CPlusPlus11;
31+
}
2932
};
3033

3134
} // namespace clang::tidy::readability

clang-tools-extra/docs/clang-tidy/checks/list.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ Clang-Tidy Checks
377377
:doc:`readability-container-data-pointer <readability/container-data-pointer>`, "Yes"
378378
:doc:`readability-container-size-empty <readability/container-size-empty>`, "Yes"
379379
:doc:`readability-convert-member-functions-to-static <readability/convert-member-functions-to-static>`, "Yes"
380-
:doc:`readability-avoid-default-lambda-capture <readability/avoid-default-lambda-capture>`,
380+
:doc:`readability-avoid-default-lambda-capture <readability/avoid-default-lambda-capture>`, "Yes"
381381
:doc:`readability-delete-null-pointer <readability/delete-null-pointer>`, "Yes"
382382
:doc:`readability-duplicate-include <readability/duplicate-include>`, "Yes"
383383
:doc:`readability-else-after-return <readability/else-after-return>`, "Yes"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Warns on default lambda captures (e.g. ``[&](){ ... }``, ``[=](){ ... }``).
77

88
Captures can lead to subtle bugs including dangling references and unnecessary
99
copies. Writing out the name of the variables being captured reminds programmers
10-
and reviewers to know what is being captured.
10+
and reviewers about what is being captured.
1111

1212
This check does not warn on variable-length array (VLA) captures. VLAs are not
1313
ISO C++, and it is impossible to explicitly capture them as the syntax for doing

0 commit comments

Comments
 (0)