This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New name mangling in g++


On Mon, Jan 29, 2001 at 05:51:55PM +0100, Jakub Jelinek wrote:
> 
> const is part of the interface, it is encoded with the K.
> I believe this is a bug in mangle.c because:
> $ c++filt -s gnu-new-abi _ZN1M5mixedERK4struS0_RS0_S0_S2_S0_S3_S0_
> M::mixed(const stru&, M::mixed, M::mixed&, M::mixed, const stru, M::mixed, const stru&, M::mixed)
> I believe it should be mangled as
> _ZN1M5mixedERK4struS2_RS1_S1_S3_S2_S4_S1_
> , am just looking into mangle.c to see what's going on.

??? I get 

$ /work/inst/bin/c++filt 
_ZN1M5mixedERK4struS0_RS0_S0_S2_S0_S3_S0_
M::mixed(stru const&, stru, stru&, stru, stru const&, stru, stru&, stru)
_ZN1M5mixedERK4struS2_RS1_S1_S3_S2_S4_S1_
_ZN1M5mixedERK4struS2_RS1_S1_S3_S2_S4_S1_

The backreference names start with S_, not S0_.  In this case

S_	M
S0_	stru
S1_	stru const
S2_	stru const &

so I think the correct encoding is

_ZN1M5mixedERK4struS1_RS0_S0_S2_S1_S3_S0_

(S3_ == RS0_ == stru &)

This is just what you have with 1 subtracted from each digit...

zw

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]