c++/9377: g++ 64bit calls wrong function -> Multi-inheritance: pointer to member function of the 2nd base calss points to wrong place
Wolfgang Bangerth
bangerth@ticam.utexas.edu
Tue Jan 21 17:36:00 GMT 2003
The following reply was made to PR c++/9377; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Andrew Xiong <axiong@ca.ibm.com>
Cc: gcc-bugs@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
Date: Tue, 21 Jan 2003 11:30:30 -0600 (CST)
> Actually, with the C++ compiler (xlC) on AIX, for both 32-bit and 64-bit
> compiling, we can do:
> PMF aPMF = (char *(D::*)()) &B2::bar ;
> And also, with g++ for 32-bit compiling, we can do:
> PMF aPMF = (char *(D::*)()) &B2::bar ;
>
> The problem is only for g++ 64-bit compiling: we can not do it only for g++
> 64-bit compiling.
The fact that it works with one compiler and not with the other is of
course no proof of either one being right :-) What I meant is that the
question 32 vs 64 bit affects the layout of the virtual function table, so
I wouldn't be surprised if an accidentially working program breaks when
you change something like the layout of the vt.
That being said, I reopened the report to let others have a second look on
things.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth/
More information about the Gcc-prs
mailing list