[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:27 PST 2025


================
@@ -1645,3 +1645,41 @@ void create() {
 }
 
 } // namespace issue82023
+
+namespace custom_invalidation
+{
+
+struct Database {
+  void CloseConnection();
+  static void StaticCloseConnection(Database&);
+  friend void FriendCloseConnection(Database&);
+  void Query();
+};
+
+void Run() {
----------------
vbvictor wrote:

Please add tests with template invalidation function, templated `struct Database` class, templated `CloseConnection` method.

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


More information about the cfe-commits mailing list