[Bug c++/89089] [9 regression] various ICEs in range-v3's 1.0 branch

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 29 15:40:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89089

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan 29 15:39:40 2019
New Revision: 268368

URL: https://gcc.gnu.org/viewcvs?rev=268368&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/abi/no_unique_address4.C
    trunk/gcc/testsuite/g++.dg/abi/no_unique_address5.C
    trunk/gcc/testsuite/g++.dg/cpp2a/no_unique_address2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c


More information about the Gcc-bugs mailing list