Should clang-tidys 'use-after-move' consider std::forward

Hello everybody,

when reading the code for `misc-use-after-move` in clang-tidy i saw,
that the check explicitly matches "std::move", but not "std::forward".
Since "std::forward" is a conditional move, shouldn't it be matched as
well, or is it implicitly caught?

Regards, Jonas


Interesting point – I don’t recall offhand, but I assume this isn’t currently handled and should be added.

I wrote a testcase, that should cover std::move, std::forward and static_cast<T&&>(t) which should initiate a move as well, if i recall correctly. Only std::move is diagnosed.

Bugreport, Code + Output are here: