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: Internal compiler error 61. (another c++ code that no longer compile under under 2.95)


> #include <iostream>
> #include <iterator>
> 
> template <class T> 
> class Base {
> public:
>   typedef T value_type;
> };
> 
> template <class T>
> class Derived : public Base<T> {
> public:
>   void foo(value_type) {}
> };
> 
> int main()
> {
>   cout << "OK" << endl;
>   return 0;
> }

Thanks for your bug report. This will be fixed in gcc 2.95.1
(hopefully), which will report

a.cc:13: variable or field `foo' declared void
a.cc:13: template declaration of `int foo'
a.cc:13: syntax error before `{'
a.cc:13: missing ';' before right brace

The problem is that 'value_type' is a global, here, and not from the
base class. Welcome to standard C++.

Regards,
Martin


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