This is the mail archive of the gcc-patches@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]

Re: C++ PATCH: offsetof with multiple bases


>>>>> Nathan Sidwell <nathan@acm.org> writes:

 > here's a patch which deals with offsetof(T,m) handling. It permits that
 > to be used for all but virtual base classes. For those paying attention,
 > this is making offsetof handling nice and permissive, rather than the
 > warnings I previously attempted to do! (I reserve the right to be fickle
 > :-) The comment was made (by someone who I've forgotten) that although
 > undefined, it'd be nice if offsetof worked for all but virtual base
 > members.

It's not undefined, it's ill-formed.  The standard says,

18.1 - Types [lib.support.types]

-5- The macro offsetof accepts a restricted set of type arguments in this
    International Standard. type shall be a POD structure or a POD union.

Jason


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