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]

g++-980308: Problems with template template parameters


Hi

I have already reported this compiler error a few weeks ago,
but noone has responded. :-(
The following code causes an internal compiler error:

/*-------------------bug.C----------------------*/
template < class T, template <class> class E1, template <class> class E2 >
struct Add {
  Add(const E1<T>& e1, const E2<T>& e2) {}
};


template < class T, template <class> class E1, template <class> class E2 >
struct Mul {
  Mul(const E1<T>& e1, const E2<T>& e2) {}
};


template < class T >
struct Lit {
  Lit(const T& t) {}
};


template < class T >
struct Id {
  Add < T, Id, Lit > operator+(const T& t) const {
    return Add < T, Id, Lit >(this, Lit<T>(t));
  }

  Mul < T, Id, Lit > operator*(const T& t) const {
    return Mul < T, Id, Lit >(this, Lit<T>(t));
  }
};
/*-----------------------------------------*/

# g++ -c bug.C
bug.C:25: Internal compiler error 61.
bug.C:25: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Bernd




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