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]

Template mangling bug in egcs-2.90.16


In the following example the function f1 is referenced under the name
"f1(int)", but it should be "A<int> f1<int>(int)".

$ cat template.cc
template <class X>
struct A
{
  X x;
  friend A f1 (X);
};

template <class X> A<X> f1 (X) { A<X> a; return a; }
template <class X> A<X> f2 (const A<X>& a) { return f1 (a.x); }

template A<int> f1 (int);
template A<int> f2 (const A<int>&);
$ gcc -c template.cc
$ nm -C template.o
00000000 ? __FRAME_BEGIN__
         U f1(int)
00000000 T A<int> f1<int>(int)
00000012 T A<int> f2<int>(A<int> const &)
00000000 t gcc2_compiled.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org


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