This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Internal compiler error
- To: egcs-bugs at cygnus dot com
- Subject: Internal compiler error
- From: Helmut Jarausch <jarausch at IGPM dot Rwth-Aachen dot DE>
- Date: Tue, 23 Jun 1998 13:43:52 +0200 (CST)
Hello,
if you are interested, here is a tiny source which triggers an
internal compiler error in
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
#include <math.h>
class Vector
{ double V[10];
public:
Vector() { for (int i=0; i < 10; i++) V[i]=0.0; }
double& operator[](int i) { return V[i-1]; }
double operator[](int i) const { return V[i-1]; }
};
template < typename PType, double Fct(double,PType) >
const Vector MV_Apply_P(const Vector& S, PType P)
{ Vector R(S.dim());
for (int i= S.dim(); i >= 1; i--) R[i]= Fct(S[i],P);
S.recycle();
return R;
}
int main()
{ Vector A;
for ( int i= 1; i <= 10; i++ ) A[i]= i;
cout << MV_Apply_P<double,pow>(A,3) << endl;
}
Regards,
--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany