Closed as not planned
Description
As a dumb example
#include <utility>
struct Foo {
Foo() {}
Foo(Foo&&o) { o._is_valid = false; }
bool is_valid() { return _is_valid; }
private:
bool _is_valid = true;
};
int main() {
Foo a;
Foo b{std::move(a)};
if (a.is_valid()) { return 0; } else { return 1; }
}
Where is_valid is actually a check if this object is usable, the MoveChecker is hardcoded to assume that this function must be called [is]empty. This should presumably be an attribute, such as clang::movesafe so that functions that are coded movesafe can be tagged properly.
Likewise, clang::movestatereset or something like such should be introduced for functions that reset the state (but I haven't had that issue, yet).