From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7605 invoked by alias); 21 Jan 2003 17:27:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 7579 invoked by uid 48); 21 Jan 2003 17:27:05 -0000 Date: Tue, 21 Jan 2003 17:27:00 -0000 Message-ID: <20030121172705.7578.qmail@sources.redhat.com> To: axiong@ca.ibm.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, axiong@ca.ibm.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/9377: g++ 64bit calls wrong function -> Multi-inheritance: pointer to member function of the 2nd base calss points to wrong place X-SW-Source: 2003-01/txt/msg01155.txt.bz2 List-Id: Synopsis: g++ 64bit calls wrong function -> Multi-inheritance: pointer to member function of the 2nd base calss points to wrong place State-Changed-From-To: closed->open State-Changed-By: bangerth State-Changed-When: Tue Jan 21 17:27:05 2003 State-Changed-Why: I am still pretty sure that what you try is not legal, but I'll reopen it and let someone else have a second look on it. My questions are (maybe you can send an answer to these): - why do you need the cast from &B2::bar to D::*? I think that's the crucial step -- if your program is supposed to work, then this cast would not be necessary, but rather be an implicit default conversion. - what's the purpose of the select() method you have there? The comment implies that without it, there's a problem. But what exactly is it? My idea about this is that if you take &B2::bar, then since B2::bar is a virtual function, the member function pointer actually is a pointer into the virtual function table of B2. If you later call the function with an object of type "D", then you call it through the virtual function table of D, so a conversion is necessary. The question is whether this happens. Regards Wolfgang PS: The code works on sparc in 32 and 64 bit mode as you would expect it, but I can't check for the PPC platform you have. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9377