parse error in nested templates

Stephan Kulow coolo@kde.org
Wed Oct 20 06:27:00 GMT 1999


Hi!

In the following C++ code, egcs 1.1.2 and gcc 2.95.1 both
end with parse error in line 9 on both Linux and Solaris
when compiled with -pedantic.

===
template<class T> class DList {
public:
   typedef void *Iterator;
};

template<class RowT, class CellT> class DMatrix {
public:
  void dummy() {
     DList<CellT>::Iterator it;  // <--- parse error
  }
};
====

It happened within koffice and I minimized the code
to the above snippet. I had to remove -pedantic from
the compile flags, but would like to readd it, as it's
quite useful for keeping the code portable and clean :)

Greetings, Stephan

-- 
As long as Linux remains a religion of freeware fanatics,
Microsoft have nothing to worry about.  
                       By Michael Surkan, PC Week Online


More information about the Gcc-bugs mailing list