Inspired by #34320 (review).
Problem
A few function signatures in the codebase use rvalue references for trivially copyable types, forcing callers to std::move() values where there is no benefit - for trivially copyable types, moving is semantically identical to copying (see https://godbolt.org/z/hdrn17v9b).
Additionally, some call sites use std::move() on plain enums and primitive types where it is basically just noise.
Note: CheckTriviallyCopyableMove remains false - std::move() on trivially copyable types is still permitted where it serves as intent documentation (e.g. signaling that a value should not be reused after a call).
Fix
- Document why
CheckTriviallyCopyableMoveis kept disabled (to preservebugprone-use-after-movecoverage on trivially copyable types wherestd::movesignals intent), cherry-picked from #34523 - Change
EmplaceCoinInternalDANGERto takeconst COutPoint&instead ofCOutPoint&& - Change logging functions to take
const SourceLocation&instead ofSourceLocation&& - Remove
std::move()on enum types in RPC constructors and onbool/intmembers intxgraph.cpp