A forwarding reference is passed on with std::move, which moves from lvalues the caller still owns

tx0/cpp:move-of-forwarding-referencerecommendedwarningreliability/memory-safetydepth fastbug

What it finds

A parameter T &&x of a function template binds to lvalues as well as rvalues. std::move(x) moves out of the caller's lvalue as if it were a temporary; std::forward<T>(x) keeps lvalues as lvalues.

From the rule's source, move_of_forwarding_reference.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:move-of-forwarding-reference" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:move-of-forwarding-reference] reason="..."

tx0 explain tx0/cpp:move-of-forwarding-reference shows the same in the terminal. Found a false positive? Report it.