This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: possible structure layout bug


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.


-- Jie


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]