c++/3309: 'string' typedef bug
George Wu
gwu@georgewu.com
Wed Jun 20 18:36:00 GMT 2001
>Number: 3309
>Category: c++
>Synopsis: Incorrect compilation error.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 20 18:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: George Wu
>Release: 3.0
>Organization:
>Environment:
System: Linux pc 2.2.17 #5 Fri Oct 27 23:29:32 PDT 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/usr/local/gcc-3.0 --enable-threads
>Description:
#include <string>
class Test
{
public:
typedef int IntType;
typedef string StringType;
};
Compiling the above test program generates the following incorrect error:
test.cxx:11: ISO C++ forbids declaration of `string' with no type
test.cxx:11: parse error before `;' token
The same code works under gcc 2.95.x.
>How-To-Repeat:
Type "g++ <test>.cxx".
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list