I have a pointer that sometime ago pointed to alive object, but now this object is dead. Is it true, that if I don't use this dead object (don't dereference pointer, don't use methods, etc) there is no undefined behavior?
Code example:
int* x = new int;
int* y = x;
delete x;
// From now on never use *y, or y->... or something else
// that will "dereference" y.