Change the final paragraph of 2.4/II/3 as follows: """ Once offset(D) has been chosen, update sizeof(C) to max (sizeof(C), offset(D)+sizeof(D)) <ins>, and align(C) to max (align(C), nvalign(D))</ins>. <del>Note that nvalign(D) is 1, so no update of align(C) is needed.</del> S<del>imilarly, s</del>ince D is an empty base class, no update of dsize(C) is needed. """
On 4 February 2015 at 16:11, John McCall <[email protected]> wrote: > > On Apr 24, 2014, at 2:52 PM, Richard Smith <[email protected]> > wrote: > > 2.4/II/3 says: > > > > "If D is an empty proper base class: [...potentially misalign the D base > class...] Note that nvalign(D) is 1, so no update of align(C) is needed." > > > > This is not true. > > > > struct A {}; > > struct B : A { char c; }; > > struct alignas(4) D : A {}; > > struct C : B, D {}; > > > > This puts a D object at offset 1 within C, and gives C nvalign of 1, > which is obviously not right. Fortunately, GCC, Clang, and EDG all deviate > from the ABI and instead do the natural thing here (put it at offset zero > if you can, and otherwise allocate it like any other subobject). Looks like > the wording only needs a little massaging here to say the right thing. > > Catching up on my queue, and I found this very old email. Would you mind > proposing an exact wording change? > > John.
_______________________________________________ cxx-abi-dev mailing list [email protected] http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev
