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]

weird parsing error



Hi - I get a weird parsing error with the following:

----

Stats:

gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
Red Hat Linux release 5.1 (Manhattan)
Kernel 2.1.122 on an i686
My machine has 2 400mHz PII processors, 256MB RAM...

and 

gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
SunOS Release 5.6 Version Generic_105181-09 [UNIX(R) System V Release 4.0]
Sun Ultra 2 Model 2200 with 2 200 MHz UltraSPARC procs, 1024MB RAM...

----

When compiling the following:

--------
#include <stddef.h> // for size_t
#include <vector>

class A {
public:
    typedef size_t size_type;
};

class B : public A, public vector<int>
{
public:
    B(size_type r=0);
};
--------

I get the following errors:

> g++ -g -W -Wall -c bad.cpp
bad.cpp:12: parse error before `r'

----

Is this a bug, or is it a problem with the ambiguous typedef size_type 
in class A and the one in class vector? If the latter, should there be 
a better error message?




Dan




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