Reading or operating on an object after its state has been moved.
C++11 move semantics transfer resources from a source object to a target. Once an object (like `std::string` or `std::vector`) is moved from, it is left in a valid but unspecified state.
Passing an object with `std::move()` into a function or constructor, and then attempting to use the original object variable later.
1#include <iostream>2#include <string>3#include <utility>4 5void processString(std::string s) {6 std::cout << "Processed: " << s << std::endl;7}8 9int main() {10 std::string text = "Important Data";11 processString(std::move(text));12 13 // Bug: text is now in moved-from unspecified state!14 std::cout << "Original length: " << text.length() << std::endl;15 return 0;16}1#include <iostream>2#include <string>3 4void processString(const std::string& s) {5 std::cout << "Processed: " << s << std::endl;6}7 8int main() {9 std::string text = "Important Data";10 // Pass by const reference instead of moving if text is needed later11 processString(text);12 13 std::cout << "Original length: " << text.length() << std::endl;14 return 0;15}Simulate standard system builds to trigger compiler trace records and track memory crashes locally.
`std::move(text)` transfers string internal pointer buffers to `processString`. Reading `text.length()` after move yields unexpected empty or junk values.