[Bug c++/98261] Wrong optimize for virtual function
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 13 18:22:43 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98261
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is undefined behavior. A and B are unrelated types. You cannot expect to
call a virtual function of B via a pointer that is of type A.
More information about the Gcc-bugs
mailing list