https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96052
--- Comment #2 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:e47dfca5aa473e77fdff95d631dc39de87a41eec commit r11-2014-ge47dfca5aa473e77fdff95d631dc39de87a41eec Author: Jason Merrill <ja...@redhat.com> Date: Thu Jul 9 15:11:12 2020 -0400 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.