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]

Re: g++: Internal compiler error in 980214 [simplified example]


Bernd Nottelmann wrote:

Here is a strongly simplified version of the program:

--------------------------------snip--------------------------------

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));
  }
};

--------------------------------snip--------------------------------


#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'.

> My configuration is
>
> linux-2.0.33
> binutils-2.8.1.0.21
> libc.so.5.4.33
> libstdc++.so.27.2.8
>
> # gcc -v
> Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.08/specs
> gcc version egcs-2.91.08 980214 (gcc-2.8.0 release)
>
> When I took the entire Id-struct away or its operator+(...)-/operator*(...)-method,
> the error has vanished.
>
> Bernd





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