diff options
author | Jason Merrill <jason@redhat.com> | 2020-07-09 15:11:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-07-10 08:36:40 -0400 |
commit | e47dfca5aa473e77fdff95d631dc39de87a41eec (patch) | |
tree | 53f7d6d930a736ba88080c98544721a4d7da1f82 /gcc/cp/mangle.c | |
parent | a6645a826f58b68f68dff30e6e6e78542099d0cc (diff) | |
download | gcc-e47dfca5aa473e77fdff95d631dc39de87a41eec.zip gcc-e47dfca5aa473e77fdff95d631dc39de87a41eec.tar.gz gcc-e47dfca5aa473e77fdff95d631dc39de87a41eec.tar.bz2 |
c++: [[no_unique_address]] fixes. [PR96105]
We were wrongly checking is_empty_class on the result of strip_array_types
rather than the actual field type. We weren't considering the alignment of
the data member. We needed to handle unions the same way as
layout_nonempty_base_or_field.
gcc/cp/ChangeLog:
PR c++/96105
PR c++/96052
PR c++/95976
* class.c (check_field_decls): An array of empty classes is not an
empty data member.
(layout_empty_base_or_field): Handle explicit alignment.
Fix union handling.
gcc/testsuite/ChangeLog:
PR c++/96105
PR c++/96052
PR c++/95976
* g++.dg/cpp2a/no_unique_address4.C: New test.
* g++.dg/cpp2a/no_unique_address5.C: New test.
* g++.dg/cpp2a/no_unique_address6.C: New test.
Diffstat (limited to 'gcc/cp/mangle.c')
0 files changed, 0 insertions, 0 deletions