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]

No Subject


I could not compile my C++ source code with g++ compiler(egcs-1.01 release).
the source code is below.

// tcategory.c

template<class V,class S>
class AdditiveCategory{
public:
  friend V operator + (const V& lhs,const V& rhs){
	 V temp(lhs);
	 return temp+=rhs;
  } 
};

template<class T,int i>
class AClass: public AdditiveCategory<AClass<T,i>,T>
{
public:
  AClass(const T& t):val(t){}
  AClass(const AClass& a):val(a.val){}
  AClass& operator+=(const AClass& a){val+=a.val;return *this;}
private:
  T val;
};

void main()
{
  AClass<double,1> a(3);
}

The compile time error is below.

tcategory.c:5: Internal compiler error.
tcategory.c:5: Please submit a full bug report to `egcs-bugs@cygnus.com'.

How can I fix the error? I would greatly appreciate your advice.



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