From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22708 invoked by alias); 3 Dec 2010 13:45:24 -0000 Received: (qmail 22699 invoked by uid 22791); 3 Dec 2010 13:45:23 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Dec 2010 13:45:18 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 01FC290847; Fri, 3 Dec 2010 14:45:16 +0100 (CET) Date: Fri, 03 Dec 2010 13:45:00 -0000 From: Martin Jambor To: Jason Merrill Cc: GCC Patches , Richard Guenther , Jan Hubicka Subject: Re: [PATCH, PR 45934 4/6] Dynamic type change detection Message-ID: <20101203134515.GB3371@virgil.arch.suse.de> Mail-Followup-To: Jason Merrill , GCC Patches , Richard Guenther , Jan Hubicka References: <20101201201618.861802217@virgil.suse.cz> <20101201201711.231211674@virgil.suse.cz> <4CF82AE8.3040901@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4CF82AE8.3040901@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg00298.txt.bz2 Hi, On Thu, Dec 02, 2010 at 06:25:28PM -0500, Jason Merrill wrote: > On 12/01/2010 03:16 PM, Martin Jambor wrote: > >and there are no unions of non-POD types > > This is actually no longer true in C++0x. OK... but from what I have googled I understand that types with virtual functions are still explicitely not allowed to be fields of a union, right? > > >dynamic types. It assumes that destructors begin with assignment into > >all VMT pointers and that constructors essentially look in the > >following way: > > > >1) The very first thing they do is that they call constructors of the > > components (including ancestor sub-objects) that have them. > > >2) Then VMT pointers of this and all its ancestors is set to new > > values corresponding to the type corresponding to the constructor. > > Slight clarification: this happens after calling constructors for > base sub-objects and before calling constructors for member > sub-objects. OK, I really only care about the sub-objects representing ancestors (virtual or otherwise) as type of the user-defined member sub-objects is not derived from the type of whatever other object they are embedded in. In any event, passing the correct type to any constructor is not necessary. > > The rest of the writeup all sounds correct. > Great, thanks a lot, Martin