This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/8964: [3.3 regression] [ABI] different mangling of names


Old Synopsis: 2 different templates mangled with the same name
New Synopsis: [3.3 regression] [ABI] different mangling of names

State-Changed-From-To: closed->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 16 13:10:07 2002
State-Changed-Why:
    This little code
    ---------------------------
    template < class T,int I > struct A {
      typedef int X;
    };
    
    template<class T> struct A<T,3> {
      typedef char X;
    };
    
    template <template <class B,int I> class XX>
    void foo(typename XX<int,3>::X a){}
    
    int main() {
      foo<A>('x');   
    }
    -------------------------------
    yields different mangled names with 3.2 and 3.3, which
    is an ABI change that should probably not be there unless
    guarded by -fabi-version:
    
    tmp/g> /home/bangerth/bin/gcc-3.2.2-pre/bin/c++ -c x.cc
    tmp/g> nm x.o | grep foo
    00000000 W _Z3fooI1AEvN2XX1XE
    tmp/g> nm x.o | /home/bangerth/bin/gcc-3.2/bin/c++filt | grep foo
    00000000 W void foo<A>(XX::X)
    
    
    
    tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
    tmp/g> nm x.o | grep foo
    00000000 W _Z3fooI1AEvN2XXIiLi3EE1XE
    tmp/g> nm x.o | /home/bangerth/bin/gcc-3.2/bin/c++filt | grep foo
    00000000 W void foo<A>(XX<int, (int)3>::X)

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8964


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