[clang-tools-extra] [clang-tidy] Fix false positive in bugprone-use-after-move for std::tie (PR #192895)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 07:56:09 PDT 2026


================
@@ -230,6 +230,14 @@ New check aliases
 Changes in existing checks
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+- Improved :doc:`bugprone-use-after-move
+  <clang-tidy/checks/bugprone/use-after-move>` check to no longer emit a
+  false positive when a moved-from variable is reinitialized via a
+  ``std::tie()`` assignment (e.g. ``std::tie(a, b) = f(std::move(a),
+  std::move(b))``). The tuple assignment writes back through the stored
+  references, which fully reinitializes the captured variables.
+
+
----------------
EugeneZelenko wrote:

```suggestion
```

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


More information about the cfe-commits mailing list