[clang-tools-extra] [clang-tidy] Add `performance-explicit-move-constructor` check (PR #122599)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 12 06:15:27 PST 2025


dodicidodici wrote:

> This check sounds a bit strange. Is this issue common in real-world projects, do we have some data? It's the first time I've heard of it. Why would people deviate from the standard signature for move constructors?

It's anecdotal, but I've encountered it in a few places in a private codebase. I don't think it's a *really* common issue, but it'd be nice to have a lint warning for this.

> We could perhaps consider making this check a bit more general and enforce that all 5 special member functions have the correct signature (including ref-qualification and `noexcept`).

There's `performance-noexcept-move-constructor` and `performance-noexcept-destructor` that cover missing `noexcept`s. Also yes, making it more generic is a great idea (altough I thought there were other lints that were doing that).

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


More information about the cfe-commits mailing list