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]

internal error: default value to a friend function



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) ;
};



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