possible structure layout bug

Daniel Jacobowitz drow@false.org
Thu Jun 10 13:05:00 GMT 2004


On Thu, Jun 10, 2004 at 02:21:27PM +0800, Jie Zhang wrote:
> Daniel Jacobowitz wrote:
> 
> >On Wed, Jun 09, 2004 at 02:06:19PM -0700, Richard Henderson wrote:
> >
> >>On Wed, Jun 09, 2004 at 09:47:06PM +0100, Andrew Haley wrote:
> >>
> >>Actually, isn't inheritence is by definition non-POD?
> >
> >
> >Nope.  If I've got the right bit of the standard:
> >
> >  A POD-struct is an aggregate class that has no non-static data
> >  members of type pointer to member, non-POD-struct, non-POD-union (or
> >  array of such types) or reference, and has no user-defined copy
> >  assignment operator and no user-defined destructor.
> >
> >Base classes are not listed.  This matches how I check in GDB for
> >classes to pass by reference.
> >
> 
> But it is listed in the definition of aggregate, which is defined by the 
> standard as following (8.5.1):
> 
>   An aggregate is an array or a class with no user-declared
>   constructors, no private or protected non-static data members,
>   no base classes, and no virtual functions.

Huh.  Thanks.

-- 
Daniel Jacobowitz



More information about the Gcc mailing list