This is the mail archive of the gcc@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: egcs-1.1.1 on Solaris2.6 bug?



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?


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