This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bug in gcc 2.95
- To: seefelds at MAGELLAN dot UMontreal dot CA
- Subject: Re: bug in gcc 2.95
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 12 Aug 1999 11:00:16 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <37B18F9A.5661F7DC@magellan.umontreal.ca>
> 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