parsing error...

Daniel X. Pape
Fri Nov 13 07:49:00 GMT 1998

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



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


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 {
    typedef size_t size_type;

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

I get the following errors:

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


I think that this is because of the ambiguous typedef size_type in
class A and the one that is in class vector. Should there be a better
error message?


More information about the Gcc-bugs mailing list