https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98261
--- Comment #3 from 。 <570070308 at qq dot com> --- (In reply to Jonathan Wakely from comment #2) > The bug reporting guidelines tell you to try -fsanitize=undefined before > reporting a bug. That would have told you your code is wrong: > > A > d.C:26:14: runtime error: member call on address 0x7ffe71274e18 which does > not point to an object of type 'A' > 0x7ffe71274e18: note: object is of type 'B' > 00 00 00 00 28 20 40 00 00 00 00 00 40 20 40 00 00 00 00 00 18 4e 27 71 > fe 7f 00 00 00 00 00 00 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'B' > B thanks, I will pay attention to it next time.