STL's equal: Internal compiler error.

Stefan Eggers seggers@semyam.dinoco.de
Wed Mar 25 13:00:00 GMT 1998


Hi!

Just found out the STL's equal template triggers an internal error
in egcs dated 980221.  The smallest program I could reproduce it
with is this:

----------------------------------------------------------------------
#include <algorithm>
#include <functional>

template<class T>
class A
{
public:
   T* data;
   bool operator==(const A<T>& rhs) const
   {
      return equal(data, data+10, rhs.data, equal_to);
   }
};

int main()
{
   A<int> a, b;
   return a == b;
}
----------------------------------------------------------------------

The message I get is this:

----------------------------------------------------------------------
/usr/local/include/g++/stl_algobase.h: In function `bool equal<int *,
 int *, equal_to<T>>(int *, int *, int *, struct equal_to<T>)':
/usr/local/include/g++/stl_algobase.h:333: Internal compiler error.
/usr/local/include/g++/stl_algobase.h:333: Please submit a full bug
 report to `egcs-bugs@cygnus.com'.
----------------------------------------------------------------------

(line wrapping by me)

Stefan.



More information about the Gcc-bugs mailing list