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 compiler error


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





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