[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: parse error in nested templates
From:       "Doug Gregor" <gregod () rpi ! edu>
Date:       1999-10-20 14:56:28
[Download RAW message or body]

This is actually correct behavior according to the C++ standard (Section
14.6.2 on Dependent names). The fix is to change line 9 to:
    typename DList<CellT>::Iterator it;
This is because of the dependency created by CellT.

    Doug Gregor
    gregod@rpi.edu


----- Original Message -----
From: Stephan Kulow <coolo@kde.org>
To: <gcc-bugs@gcc.gnu.org>
Cc: <koffice@kde.org>
Sent: Wednesday, October 20, 1999 9:27 AM
Subject: parse error in nested templates


> 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
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic