https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92708
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Akhilesh Kumar from comment #0) > delete pb; > pa2 = dynamic_cast<A*>(pb); This is undefined behaviour, the pointer pb is no longer valid. Also be aware that GCC 8.3 is the oldest release still supported by the GCC project.