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: typedef bug in egcs 1.1.2 on Solaris 7.0



Hi,

sorry, but what do you meen by 'typename'. The namespace
prefix std:: ???

I tried the same peace of code around one year ago with one
of the first public egcs version and it worked. So it seams
to be an new _feature_ of 1.1.2.

The code again and error messag I get:

--------------------------------------------------------------
#include <list>
using namespace std;

template <class T> class A {

  list<T> _value;

public:

  list<T>::iterator valueBegin(void)  { return _value.begin(); }

  list<T>::iterator end(void) { return _value.end(); }

  typedef list<T>::iterator valueIterator;

  void add(const T & t) { _value.push_back(t); }

};

int main (int argc, char **argv)
{
  A<int> intA;
  A<int>::valueIterator intAI;

  intA.add(5);
  intA.add(7);
  intA.add(9);

  for (intAI = intA.begin(); intAI != intA.end(); intAI++)
    cout << "A elem: " << (*intAI) << endl;

  return 0;
}                    
-----------------------------------------------------------------

egcsBug.cpp:10: syntax error before `('


thanks
  Johannes

> On Apr 28, 1999, Johannes Behr <jbehr@igd.fhg.de> wrote:
> 
> > Sorry, but I still get the same error message
> 
> You must have missed `typename' in one of the three places.  After
> inserting `typename' in the three lines Mumit Khan suggested, I don't
> get any errors.
> 
> -- 
> Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
> {oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
> oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
> *** E-mail about software projects will be forwarded to mailing lists
> 
> 




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