[clang-tools-extra] Extend bugprone-use-after-move check to allow custom invalidation functions (PR #170346)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 2 11:50:26 PST 2025


================
@@ -1,5 +1,5 @@
-// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX11 %s bugprone-use-after-move %t -- -- -fno-delayed-template-parsing
-// RUN: %check_clang_tidy -std=c++17-or-later %s bugprone-use-after-move %t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX11 %s bugprone-use-after-move %t -- -config="{CheckOptions: {bugprone-use-after-move.InvalidationFunctions: 'Database::StaticCloseConnection;Database::CloseConnection;FriendCloseConnection'}}" -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++17-or-later %s bugprone-use-after-move %t -- -config="{CheckOptions: {bugprone-use-after-move.InvalidationFunctions: 'Database::StaticCloseConnection;Database::CloseConnection;FriendCloseConnection'}}" -- -fno-delayed-template-parsing
----------------
vbvictor wrote:

Could we split into multiple `RUN` directives to keeps lines at reasonable length (see other test files with `-config`).

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


More information about the cfe-commits mailing list