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

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 08:17:30 PST 2026


vbvictor wrote:

I'm -1 on separating this checks because we essentially will duplicate a huge portion of logic into multiple places which can double the time of analysis and we need to keep two versions in sync.

One thing we can do is provide better diag message like:
```
warning: 'X' used after it was invalidated by 'MyFunction' call [use-after-move].
note: invalidation occurred here
```
So we clearly show that it's not `std::move/std::forward` but a custom function.

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


More information about the cfe-commits mailing list