public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3309: 'string' typedef bug
@ 2001-06-21  1:56 Artem Khodush
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Khodush @ 2001-06-21  1:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/3309; it has been noted by GNATS.

From: "Artem Khodush" <artem@duma.gov.ru>
To: <gwu@acm.org>
Cc: <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>
Subject: Re: c++/3309: 'string' typedef bug
Date: Thu, 21 Jun 2001 12:39:02 +0400

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/3309: 'string' typedef bug
@ 2001-06-20 18:36 George Wu
  0 siblings, 0 replies; 2+ messages in thread
From: George Wu @ 2001-06-20 18:36 UTC (permalink / raw)
  To: gcc-gnats

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-21  1:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21  1:56 c++/3309: 'string' typedef bug Artem Khodush
  -- strict thread matches above, loose matches on Subject: below --
2001-06-20 18:36 George Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).