From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25470 invoked by alias); 28 Sep 2005 02:32:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25428 invoked by alias); 28 Sep 2005 02:31:56 -0000 Date: Wed, 28 Sep 2005 02:32:00 -0000 Message-ID: <20050928023156.25426.qmail@sourceware.org> From: "dberlin at dberlin dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050714141428.22488.micis@gmx.de> References: <20050714141428.22488.micis@gmx.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/22488] [4.1 Regression] C++ generates incorrect overlapping fields X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg03461.txt.bz2 List-Id: ------- Additional Comments From dberlin at gcc dot gnu dot org 2005-09-28 02:31 ------- Subject: Re: [4.1 Regression] C++ generates incorrect overlapping fields On Wed, 2005-09-28 at 02:06 +0000, mark at codesourcery dot com wrote: > ------- 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 parlance is that of GCC. I didn't invent DECL_CONTEXT :) > > > The direct context, or the outermost containing type? > > the "direct context". Okay, then this is my bug, not yours :) I'll change the summary in a moment. > > 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.) Well, yes, if you link everything together using a list like that, and only store the offset in a shared field decl. But if you had a nice vector of std::pair, you wouldn't have to copy everything. :) > > > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22488