This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3309: 'string' typedef bug
- To: <gwu at acm dot org>
- Subject: Re: c++/3309: 'string' typedef bug
- From: "Artem Khodush" <artem at duma dot gov dot ru>
- Date: Thu, 21 Jun 2001 12:39:02 +0400
- >Received: from artem by mailsrv.duma.gov.ru (SMI-8.6/SMI-SVR4)id MAA12390; Thu, 21 Jun 2001 12:42:06 +0400
- Cc: <gcc-gnats at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>
- References: <200106210129.SAA04690@pc.georgewu.com>
> #include <string>
>
>
> class Test
> {
> public:
>
> typedef int IntType;
> typedef string StringType;
> };
>
>test.cxx:11: ISO C++ forbids declaration of `string' with no type
>test.cxx:11: parse error before `;' token
This is not a bug, though the error message is
somewhat misleading. Gcc 3.0 is much closer
to c++ standard then 2.95, so <string> header
does not define class string in the global
namespace anymore.
Either write
typedef std::string StringType;
or
using std::string; // just after including <string>