This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Template instatiation bug.
- To: egcs-bugs at cygnus dot com
- Subject: Template instatiation bug.
- From: Roy Dragseth <royd at math dot uit dot no>
- Date: Thu, 30 Oct 1997 17:30:28 MET
- Reply-to: Roy Dragseth <royd at math dot uit dot no>
Hi, I just discovered what I beleive is a bug in egcs-971023.
Configuration: HP-UX 10.20, gas, native ld.
Error:
g++ template_test.cc -o template_test.out
/usr/ccs/bin/ld: Unsatisfied symbols:
operator>>(istream &, C_matrix<double> &)(code)
collect2: ld returned 1 exit status
while compiling this file:
--------------------------------------------------------------------------------
#include <iostream.h>
template<class T>
class C_matrix
{
protected:
T* v_;
friend istream& operator>>(istream &s, C_matrix &A);
};
template <class T>
istream& operator>>(istream &s, C_matrix<T> &A)
{
s >> *A.v_;
return s;
}
main()
{
C_matrix<double> A;
cin >> A;
}
// Local Variables:
// compile-command: "g++ template_test.cc -o template_test.out"
// eval: (c-toggle-auto-hungry-state 1)
// End:
--------------------------------------------------------------------------------
explicit instantiation didn't work either.
Roy.