This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/2976: problem with compiling std::getline
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libstdc++/2976: problem with compiling std::getline
- From: snyder at fnal dot gov
- Date: Sun, 27 May 2001 23:50:25 -0500
- Reply-To: snyder at fnal dot gov
>Number: 2976
>Category: libstdc++
>Synopsis: problem with compiling std::getline
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Sun May 27 21:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: scott snyder
>Release: 3.0 20010525 (prerelease)
>Organization:
>Environment:
System: Linux karma 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long
>Description:
gcc gives errors for the source below.
>How-To-Repeat:
---------------------------------------------------------------------
#include <string>
#include <istream>
void foo (std::istream& s)
{
std::string line;
std::getline (s, line);
}
---------------------------------------------------------------------
>Fix:
This seems to work. (Although it obviates some of the possible
benefit of having istream distinct from iostream in the first place.)
2001-05-27 scott snyder <snyder@fnal.gov>
* include/bits/std_istream.h: Include std_ostream.h.
Index: libstdc++-v3/include/bits/std_istream.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_istream.h,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 std_istream.h
--- std_istream.h 2001/05/14 19:49:04 1.2.2.2
+++ std_istream.h 2001/05/28 04:34:41
@@ -38,6 +38,7 @@
#include <bits/std_ios.h>
#include <bits/std_limits.h> // For numeric_limits
+#include <bits/std_ostream.h>
namespace std
{
>Release-Note:
>Audit-Trail:
>Unformatted: