This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22488] [4.1 Regression] C++ generates incorrect overlapping fields
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Sep 2005 02:06:39 -0000
- Subject: [Bug c++/22488] [4.1 Regression] C++ generates incorrect overlapping fields
- References: <20050714141428.22488.micis@gmx.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mark at codesourcery dot com 2005-09-28 02:06 -------
Subject: Re: [4.1 Regression] C++ generates incorrect overlapping
fields
dberlin at gcc dot gnu dot org wrote:
> However, the questions still remains, what is the offset supposed to be relative to?
The beginning of the type in which the field is contained, which I think
means, in your parlance:
> The direct context, or the outermost containing type?
the "direct context".
In other words, if C has a field of type B at offset 32, and B has an
field "f" with offset 16, then the offset of B::f relative to C is 48.
(That's the only thing that makes any sense; otherwise, we'd have to
make a copy of B every time it appeared as field in some other type.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22488