In that code snippet wonder_woman is an “automatic variable” (in layman’s terms: it lives on the stack). It will be destructed when it goes out of scope. dianaPrince is a pointer to that object, delete-ing it invokes undefined behavior.
delete is for objects that were dynamically allocated with new.