#include #include class MyType { public: MyType() { pointer = new int; *pointer = 42; } MyType(MyType&& other) { pointer = other.pointer; other.pointer = nullptr; } ~MyType() { delete pointer; } int* pointer; }; // Although Chromium disallows non-const lvalue references, this situation is // still possible in templates. void Oops(MyType& type) { // Move is destructive. It can change |type| which is an lvalue reference. MyType local_type = std::move(type); // Work with local_type. // ... } int main(int argc, char **argv) { MyType type; // Don't move type, just pass it. Oops(type); // Oops, this is a null pointer dereference. *type.pointer = 314; }