This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1.1 on Solaris2.6 bug?
- To: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Subject: Re: egcs-1.1.1 on Solaris2.6 bug?
- From: Igor Markov <imarkov at math dot ucla dot edu>
- Date: Sun, 06 Dec 1998 12:54:35 -0800
- CC: egcs at cygnus dot com, egcs-bugs at egcs dot cygnus dot com, imarkov at ucla dot edu
- References: <3668EB97.47F47028@math.ucla.edu> <oriufq19c3.fsf@araguaia.dcc.unicamp.br>
Alexandre Oliva wrote:
>
> On Dec 5, 1998, Igor Markov <imarkov@math.ucla.edu> wrote:
>
> > template <class Sequence> void deleteAllPointersIn(Sequence& s) {
> > for (Sequence::iterator it=s.begin();it!=s.end();it++) delete *it; }
>
> > and the error message --- parse error before `='
>
> This code is buggy. Since Sequence is a template argument, any
> type member of Sequence must be prefixed by the keyword `typename'.
> Welcome to ISO C++:
>
> for (typename Sequence::iterator it=s.begin();it!=s.end();it++) delete *it; }
thanks. That helps.
OTOH, I expect a ton of problems with "anachronisms" like this and other
error situations. A compiler that only processes correct code and gives
uninformative diagnostics for wrong code won't be very popular, esp. for
ports.
I hope there is a way for the compiler to guess what the user could mean,
explain what's wrong and how and how it can be corrected. This may take
a lot of development work, but will be worth it. Perhaps, there can even
be a switch to print more guesses as to what's wrong.
--
Igor
--------------------------------------------------------------------
What should you do if you see an endangered animal eating an
endangered plant?