This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
internal error: default value to a friend function
- To: egcs-bugs at cygnus dot com
- Subject: internal error: default value to a friend function
- From: Lavoie Philippe <lavoie at zeus dot genie dot uottawa dot ca>
- Date: Tue, 8 Sep 1998 17:56:48 -0400
Hi,
For fun, you can use this code to crash egcs1.1a on a solaris2.5.1
using sparc.
template <class T> class A ;
template <class T> void fcn(double) ;
template <class T>
class A{
friend void fcn <> (double e=0) ;
};
You get this amusing output
> c++ -v -Wall -c friendA.cc
...
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.90.29 980515 (egcs-1.0.3 release).
friendA.cc:8: Internal compiler error.
friendA.cc:8: Please submit a full bug report to `egcs-bugs@cygnus.com'.
If you guys manage to find out what the problem is. Please e-mail me.
Thanks and have fun
Phil
PS The fix is as follows
template <class T> class A ;
template <class T> void fcn(double=0) ;
template <class T>
class A{
friend void fcn <> (double e) ;
};