This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
weird parsing error
- To: egcs at cygnus dot com
- Subject: weird parsing error
- From: "Daniel X. Pape" <dpape at canis dot uiuc dot edu>
- Date: Thu, 05 Nov 1998 13:27:28 -0600
- Reply-To: "Daniel X. Pape" <dpape at canis dot uiuc dot edu>
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