Rule A18-9-4 (required, implementation, automated)

An argument to std::forward shall not be subsequently used.

Rationale

Depending on the value category of parameters used in the call, std::forward may result in a move of the parameter. When the value is an lvalue, modifications to the parameter will affect the argument of the caller. If the value is an rvalue, the value may be in indeterminate state after the call to std::forward.

Example

// $Id: A18-9-4.cpp 289436 2017-10-04 10:45:23Z michal.szczepankiewicz $
#include <cstdint>
#include <iostream>
#include <utility>
template <typename T1, typename T2>
void F1(T1 const& t1, T2& t2){
// ...
};
template <typename T1, typename T2>
void F2(T1&& t1, T2&& t2)
{
f1(std::forward<T1>(t1), std::forward<T2>(t2));
++t2; // Non-compliant
};

See also

HIC++ v4.0 [9]: 17.3.3 Do not subsequently use the argument to std::forward.