[clang] [clang-tools-extra] [clang-tidy] Add readability-avoid-default-lambda-capture (PR #160150)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 4 01:32:18 PST 2025


vbvictor wrote:

> I attempted to use AI to generate the option to not warn on functions in the std:: namespace, but I don't really understand the code so I won't include it in the PR.

I if we are speaking about passing lambda in-place, the easiest form would be `lambdaExpr(IgnoreStdCalls ? unless(hasParent(callExpr(/*check function form std*/))) : anything()).bind("lambda")`. https://godbolt.org/z/6dEeY1sjc
Making further complications may be out of scope for now.

I'm personally fine landing the check as is and later make improvements if needed.

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


More information about the cfe-commits mailing list