https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95311
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8e915901deb3518d4bef73ea52eab2ece7a2bbf6 commit r11-728-g8e915901deb3518d4bef73ea52eab2ece7a2bbf6 Author: Jason Merrill <ja...@redhat.com> Date: Fri May 29 11:59:33 2020 -0400 c++: vptr ubsan and derived class [PR95311]. We weren't able to find OBJ_TYPE_REF_OBJECT walking through OBJ_TYPE_REF_EXPR because we had folded away the ADDR_EXPR. gcc/cp/ChangeLog: PR c++/95311 PR c++/95221 * class.c (build_vfn_ref): Don't fold the INDIRECT_REF. gcc/testsuite/ChangeLog: PR c++/95311 * g++.dg/ubsan/vptr-16.C: New test.