This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class
- From: Jason Merrill <jason at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Markus Trippelsdorf <markus at trippelsdorf dot de>
- Date: Mon, 29 Feb 2016 20:02:01 -0500
- Subject: Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOpRKYX5csM9PNhO6msWPMe-FAcCcixzEHiGp=WiAN567A at mail dot gmail dot com> <56A7C8AC dot 8070204 at redhat dot com> <CAMe9rOr96trJpuXrjb_-90SmFmfMCRQ57nyD-4fW7Q5ET_mvFg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1601262118020 dot 8312 at laptop-mg dot saclay dot inria dot fr> <CAMe9rOrXESQ3oJNzvXd1X9k=rD_DM+OSya_54vcRutVVPz4PjA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1601262134021 dot 8312 at laptop-mg dot saclay dot inria dot fr> <CAMe9rOpx=-s-KZzBLWteNeY3JczmJ_p0dKN8giNkWAM92D85Rg at mail dot gmail dot com> <20160126214000 dot GL3017 at tucnak dot redhat dot com> <CAMe9rOrFyPmyvnxZtohyC05mXUPPQ6DWk3aCXU8RWts+w9GH+w at mail dot gmail dot com> <alpine dot DEB dot 2 dot 20 dot 1601270858440 dot 1966 at laptop-mg dot saclay dot inria dot fr> <20160127082107 dot GN3017 at tucnak dot redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1601270953190 dot 1966 at laptop-mg dot saclay dot inria dot fr> <CAMe9rOqv4=QiW7USRc4hm=BE47bAX8MfK8J+8827xZkvjM8-VA at mail dot gmail dot com> <CAMe9rOoRZ0B8mH2yDr+KtoO_PMhUNxTp52D4Ais3vgjNekZWoA at mail dot gmail dot com>
On 01/27/2016 10:39 AM, H.J. Lu wrote:
Here is the updated patch with new testcases. OK for trunk?
This is not a complete patch.
Please update type_is_empty_record_p to use the definition from the
recent discussion:
An empty type is a type where it and all of its subobjects (recursively)
are of class, structure, union, or array type.
This shouldn't need to rely on the front-end setting a flag. Be sure to
ignore unnamed bit-fields, as they are not subobjects.
I would also suggest having this function abort if the type is
TREE_ADDRESSABLE.
Jason