public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/9450: incorrect mangled name for scope resolution template  argument
@ 2003-01-27 17:06 Catherine Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Catherine Morton @ 2003-01-27 17:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/9450; it has been noted by GNATS.

From: Catherine Morton <camorton@sympatico.ca>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
 	catherin@ca.ibm.com, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: c++/9450: incorrect mangled name for scope resolution template 
 argument
Date: Mon, 27 Jan 2003 12:05:34 -0500

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9450
 
 
 
 gcc generates exactly the same mangled name for these 2 testcases
 
 // ----------------- t1 --------------------
 struct A5 {int i;};
 template <int A5::*p> void f5(int) {}
 
 template <class T>
 void g5() {f5<&T::i>(0);}
 
 int main(void)
 {
    g5<A5>();
 }
 // ----------------------------------------
 
 name:
 _Z2f5IXadsr2A5NS0_1iEEEvi
 
 // ---------------- t2 --------------------
 
 struct A5 {int i;};
 template <int A5::*p> void f5(int) {}
 void g5() {f5<&A5::i>(0);}
 
 // ----------------------------------------
 
 name:
 _Z2f5IXadsr2A5NS0_1iEEEvi
 
 
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/9450: incorrect mangled name for scope resolution template  argument
@ 2003-01-27 17:16 Catherine Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Catherine Morton @ 2003-01-27 17:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/9450; it has been noted by GNATS.

From: Catherine Morton <camorton@sympatico.ca>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
 	catherin@ca.ibm.com, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: c++/9450: incorrect mangled name for scope resolution template 
 argument
Date: Mon, 27 Jan 2003 12:08:36 -0500

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9450
 
 oops, ignore that last message - its encoding the same name in both...
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c++/9450: incorrect mangled name for scope resolution template argument
@ 2003-01-27 14:56 catherin
  0 siblings, 0 replies; 3+ messages in thread
From: catherin @ 2003-01-27 14:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9450
>Category:       c++
>Synopsis:       incorrect mangled name for scope resolution template argument
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 14:56:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Catherine Morton
>Release:        3.2
>Organization:
>Environment:
gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-suse-linux/3.2/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit powerpc-suse-linux
Thread model: posix
gcc version 3.2
>Description:
testcase:
// ------- abc.cpp ------

struct A5 {int i;};
template <int A5::*p> void f5(int) {}
void g5() {f5<&A5::i>(0);}

// ----------------------

gcc name:
_Z2f5IXadsr2A5NS0_1iEEEvi

from ABI:
Template arguments that could be pointer-to-member constants are difficult because it is often 
not possible to distinguish them from pointers to static member functions or data members without 
doing the substitution. Therefore, the scope resolution (sr) mangling operator is used if the LHS 
operand of :: involves a template parameter. Ignoring substitutions, &T::j as a template argument 
would be encoded Xadsr1T1jE.

I don't think the gcc name is correct in this case:

_Z2f5IXadsr2A5NS0_1iEEEvi
              ^
The N here indicates that &A5::i is encoded  as "adsr" followed by 2A5 followed by the nested
name  A5::i encoded as (N2A51iE) NS0_i  (where S0_ is a substitution for the previously encoded 2A5)

So, I think that A5 is encoded 2 times in this name.

The abi example indicates that this context should not be
encoded as a nested name, so I'm guessing the correct name
should be:
_Z2f5IXadsr2A51iEEvi

so <&A5::i>  is   'IXadsr2A51iEE'

>How-To-Repeat:
g++ -c abc.cpp
nm abc.o

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-27 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27 17:06 c++/9450: incorrect mangled name for scope resolution template argument Catherine Morton
  -- strict thread matches above, loose matches on Subject: below --
2003-01-27 17:16 Catherine Morton
2003-01-27 14:56 catherin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).