bug report
Jimen Ching
jching@flex.com
Sat Jan 31 18:54:00 GMT 1998
Here's another bug report:
bug8.cc:10: warning: friend declaration `class ostream & operator <<(class ostream &, const struct Y<T> &)'
bug8.cc:10: warning: will not be treated as a template instantiation
bug8.cc:10: warning: unless you compile with -fguiding-decls
bug8.cc:10: warning: or add <> after the function name
bug8.cc: In function `class ostream & operator <<(class ostream &, const struct Y<T> &)':
bug8.cc:16: Internal compiler error 90.
bug8.cc:16: Please submit a full bug report to `egcs-bugs@cygnus.com'.
I already know about adding the "<>". But the ICE is at line 16. Btw,
what does the syntax look like if I were to add the "<>" to operator<<?
Thanks in advance...
--jc
--
Jimen Ching (WH6BRR) jching@flex.com wh6brr@uhm.ampr.org
--------------------------------------
#include <iostream.h>
#include <list>
template<class T>
struct Y
{
typedef list<T> list_type;
Y() {}
friend ostream &operator<<(ostream &, const Y<T> &);
};
template<class T> ostream &
operator<<(ostream &o, const Y<T> &)
{
typedef Y<T>::list_type::iterator i;
return o;
}
struct X
{
X() {}
};
int
main()
{
Y<X> yx;
cout << yx << endl;
}
More information about the Gcc-bugs
mailing list