EXP54-CPP. Do not access an object outside of its lifetime
Every object has a lifetime in which it can be used in a well-defined manner. The lifetime of an object begins when sufficient, properly aligned storage has been obtained for it and its initialization is complete. The lifetime of an object ends when a nontrivial destructor, if any, is called for the object and the storage for the object has been reused or released. Use of an object, or a pointer to an object, outside of its lifetime frequently results in undefined behavior .
The C++ Standard, [basic.life], paragraph 5 [ ISO/IEC 14882-2014 ], describes the lifetime rules for pointers:
Before the lifetime of an object has started but after the storage which