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: bug in gcc 2.95


> the following lines cause gcc 2.95 to raise an 
> 'internal compiler error 61' :

Thanks for your bug report. This is fixed in the mainline, but
difficult to fix for gcc 2.95.1 (at least, my fix fails in your
example).

It is also a bug in your code, which is not strictly
well-formed. Still, the compiler should not crash. To work around the
problem, you can write

#include <vector>

template <class T>
class Container : private vector<T>
{
public:
  typedef typename vector<T>::value_type value_type;
  void insert(value_type);
};

(which is completely standard C++), or

#include <vector>

template <class T>
class Container : private vector<T>
{
public:
  void insert(Container::value_type);
};

(which works with gcc 2.95 as well, as an extension).

> beside that gcc 2.95 seems to have difficulties with
> typedefs and forward declarations in parametrized classes
> in various situations.

Most likely, you are missing a few typenames here and there. gcc 2.95
supports some more strictly conforming C++ programs than earlier
versions of g++. As a side effect, it also has to enforce the rules on
typename a bit more strictly - this keyword is really necessary to
disambiguate in some cases.

Regards,
Martin


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