https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97597
--- 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:612cf351c700b6216209e3f3f4b3a0959bf2dee7 commit r11-6324-g612cf351c700b6216209e3f3f4b3a0959bf2dee7 Author: Jason Merrill <ja...@redhat.com> Date: Tue Dec 22 15:41:56 2020 -0500 c++: Fix initializing empty base from prvalue [PR97597] unsafe_return_slot_p wasn't recognizing an empty base as potentially-overlapping, which it definitely is. The change to build_base_path is to make the virtual conversion also recognized by is_empty_base_ref; unsafe_return_slot_p doesn't to handle virtual conversions, but hypothetical future callers might. gcc/cp/ChangeLog: PR c++/97597 * class.c (is_empty_base_ref): New. (build_base_path): Add NOP_EXPR after offset. * cp-tree.h (is_empty_base_ref): Declare it. * call.c (unsafe_return_slot_p): Call it. gcc/testsuite/ChangeLog: PR c++/97597 * g++.dg/init/empty3.C: New test.