This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs-1.0.1: bug handling struct in functions?
- To: egcs-bugs at cygnus dot com
- Subject: egcs-1.0.1: bug handling struct in functions?
- From: atai at ece dot ucsd dot edu (Andy Tai)
- Date: Wed, 4 Feb 1998 19:00:57 -0800 (PST)
- Cc: atai at ucsd dot edu
The following program causes both gcc 2.8 anf gcc egcs-2.90.23 980102
(egcs-1.0.1 release) to declare "internal compiler error". gcc 2.7.2.2
compiles it fine.
---bug2.cc---
template< class T >
void sort( T* t, int n )
{
struct
{
int operator()(T i, T j)
{
return (i < j) ? -1 : ((j < i) ? 1 : 0) ;
}
} c ;
sort(t, n, c, 0) ;
}
----end of bug2.cc--
The system is Irix 5.3.
%g++ -c bug2.cc
bug2.cc: In function `void sort(T *, int)':
bug2.cc:5: Internal compiler error.
bug2.cc:5: Please submit a full bug report to `egcs-bugs@cygnus.com'.
%g++ -v
Reading specs from /usr/local/egcs/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)