This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: offsetof with multiple bases
- To: nathan at cs dot bris dot ac dot uk
- Subject: Re: C++ PATCH: offsetof with multiple bases
- From: Jason Merrill <jason at cygnus dot com>
- Date: 24 Aug 1999 13:18:58 -0700
- Cc: egcs-patches at egcs dot cygnus dot com
- References: <373840C7.6CFD2E3@acm.org>
>>>>> 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