]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/ChangeLog
PR c++/89089 - ICE with [[no_unique_address]].
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2019 15:39:40 +0000 (15:39 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Jan 2019 15:39:40 +0000 (15:39 +0000)
commit107cba1143499f38426b8831811ffad96699e1d8
tree1f21833e2d6af54eca9bc56c95e022c7ebb25c54
parent780422ff1b01419be4a683dd6aa11494305f7354
PR c++/89089 - ICE with [[no_unique_address]].

In 89089, we were never actually setting DECL_SIZE on an empty data member,
because its type is a POD, so we didn't set it in the maybe-overlapping
section.  Fixed by also handling empty types there.

In 88865, we were failing to consider empty data members in
include_empty_classes.  Fixed by making end_of_class always include them.

While looking at these I noticed that the ABI says that a
potentially-overlapping data member makes its class non-layout-POD, and that
an empty data member doesn't prevent its class from being empty, so I've
implemented those points as well.

PR c++/88865 - wrong layout with [[no_unique_address]].
* class.c (check_field_decls): A potentially-overlapping field makes
the class non-layout-POD, but not non-empty.
(end_of_class): Always consider empty data members.
(layout_class_type): Set DECL_SIZE for empty fields.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268368 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/g++.dg/abi/no_unique_address4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/abi/no_unique_address5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/no_unique_address2.C [new file with mode: 0644]