Hi Eli, > From: Eli Friedman <[email protected]> > On Fri, Jul 12, 2013 at 6:46 AM, <[email protected]> wrote: > > Hi, > > attached is a patch to fix an alignment problem affecting classes derived > > from a base with no fields but with strong alignment constraints. > > > > Let A be a strongly aligned struct/class with no fields. > > Let B be a derived class with A as its direct base class. > > > > When performing the layout of B, A is correctly placed at offset 0 of B. > > However, the alignment of B is wrongly left unchanged. > > > > <snip> > > > > This patch fixes the problem with the alignment and adds a test case to > > verify that the alignment info is correctly updated. > > One thing to note is that this change may have an effect on binary > > compatibility between obj/libs built with and without this change (but > > only in the - hopefully rare - case described above). > > Index: test/CodeGenCXX/alignof.cpp > =================================================================== > --- test/CodeGenCXX/alignof.cpp (revision 0) > +++ test/CodeGenCXX/alignof.cpp (revision 0) > > Please move the test into SemaCXX, and use static_assert to verify the > alignment instead of checking the IR.
I moved the test from CodeGenCXX to SemaCXX. I renamed the test file into "alignment-of-derived-class.cpp" because I noticed that there was already a test called alignof.cpp in SemaCXX which however tested something completely different. > > + // Remember max struct/class alignment. > > This comment is useless. I removed the comment above from the patch. > > Otherwise, looks fine. > Thanks! In case, if this new version of the patch is ok, could you please commit it for me? Thanks in advance, Andrea Di Biagio SN Systems - Sony Computer Entertainment Group. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [email protected] This footnote also confirms that this email message has been checked for all known viruses. Sony Computer Entertainment Europe Limited Registered Office: 10 Great Marlborough Street, London W1F 7LP, United Kingdom Registered in England: 3277793 ********************************************************************** P Please consider the environment before printing this e-mail
patch-alignof.diff
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
