From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14162 invoked by alias); 9 Feb 2012 16:47:16 -0000 Received: (qmail 14149 invoked by uid 22791); 9 Feb 2012 16:47:15 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Feb 2012 16:46:59 +0000 From: "kamil.holubicki at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52184] Wrong object initialization in Date: Thu, 09 Feb 2012 16:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: kamil.holubicki at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg00958.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52184 --- Comment #2 from Kamil 2012-02-09 16:46:55 UTC --- Base virtual class object is corrupted when explicitly called auto generated constructor from derived class inititalization list. Attached file demonstrates problem. The only difference between constructors of Derived class is that first one explicitly states which Base1 constructor should be called. I would expect that both cout in main() print 8. Unfortunately the first one prints 0. f I enable explicit definition of Base1 constructor it fixes the problem. If I remove virtual inheritance in Derived class definition (class Derived: public A1, public A2) it works as well. Tested also on 4.6.1 version - issue still exist. Does not exist on 3.4.4.