Dangling pointers arise when an object is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the de-allocated memory.
Since P2 is pointing the memory location that has been de-allocated .So we can say P2 becomes dangling pointer.