[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sun May 25 03:58:44 PDT 2025


================
@@ -225,8 +257,9 @@ void PassByValueCheck::registerMatchers(MatchFinder *Finder) {
                                   .bind("Param"))))),
                           hasDeclaration(cxxConstructorDecl(
                               isCopyConstructor(), unless(isDeleted()),
-                              hasDeclContext(
-                                  cxxRecordDecl(isMoveConstructible())))))))
+                              hasDeclContext(cxxRecordDecl(
+                                  isMoveConstructibleInBoundCXXRecordDecl(
----------------
PiotrZSL wrote:

Maybe this could be checked in line 236, we got there record so just check if move constructor is public..

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


More information about the cfe-commits mailing list