[clang-tools-extra] [clang-tidy] Improve `bugprone-capturing-this-in-member-variable` check: add support of `bind` functions. (PR #132635)

Denis Mikhailov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 08:05:38 PDT 2025


================
@@ -64,16 +64,21 @@ AST_MATCHER(CXXRecordDecl, correctHandleCaptureThisLambda) {
 
 constexpr const char *DefaultFunctionWrapperTypes =
     "::std::function;::std::move_only_function;::boost::function";
+constexpr const char *DefaultBindFunctions = "::std::bind;::boost::bind";
----------------
denzor200 wrote:

Please add `::std::bind_front` and `::std::bind_back`: https://en.cppreference.com/w/cpp/utility/functional/bind_front
There are also Boost analogue for them - `::boost::compat::bind_front` and `::boost::compat::bind_back`:
https://www.boost.org/doc/libs/1_86_0/libs/compat/doc/html/compat.html#bind_front
https://www.boost.org/doc/libs/1_86_0/libs/compat/doc/html/compat.html#bind_back

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


More information about the cfe-commits mailing list