On June 20, 2019 4:06:58 PM GMT+02:00, Nathan Sidwell <nat...@acm.org> wrote: >On 6/20/19 9:37 AM, Richard Biener wrote: > >> I've spent some thoughts on this and I wonder whether we can >> re-implement classtype-as-base with fake inheritance (which would >> also solve the TBAA alias set issue in a natural way). That is, >> we'd lay out structs as-base and make instances of it use a >> >> class as-instance { as-base b; X pad1; Y pad2; }; >> >> with either explicit padding fields or with implicit ones >> (I didn't check how we trick stor-layout to not pad the as-base >> type to its natural alignment...). > >I think you might end up with unordered fields? virtual empty bases >don't appear in the as-base variant, and I think they could appear in >the middle of the as-instance variant. that might or might not be a >problem?
Certainly interesting, but if they are empty it might not be an issue if they are never referred to (address taken?) Richard. >nathan