diff options
author | Jason Merrill <jason@redhat.com> | 2020-12-22 15:41:56 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-12-23 17:11:05 -0500 |
commit | 612cf351c700b6216209e3f3f4b3a0959bf2dee7 (patch) | |
tree | ea53b09e0d34deb068d7312928a8e2d88fd89924 /gcc/cp/parser.c | |
parent | 3932785450fb74a886b8eb3d6f889de9766b7e8e (diff) | |
download | gcc-612cf351c700b6216209e3f3f4b3a0959bf2dee7.zip gcc-612cf351c700b6216209e3f3f4b3a0959bf2dee7.tar.gz gcc-612cf351c700b6216209e3f3f4b3a0959bf2dee7.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp/parser.c')
0 files changed, 0 insertions, 0 deletions