summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-27 01:07:29 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-27 01:07:29 +0000
commitf9039e4a846c6dfab02baef519d922ec1ca1f33f (patch)
tree557dc8c713b8270838fc406f759ba757485c4185 /libstdc++-v3
parent0858f8a2f96cc5e512ac5ada8ea29792823166cc (diff)
downloadgcc-f9039e4a846c6dfab02baef519d922ec1ca1f33f.tar.gz
2001-06-26 Benjamin Kosnik <bkoz@fillmore.constant.com>
<vakatov@ncbi.nlm.nih.gov> libstdc++/3272 * include/bits/streambuf.tcc (__copy_streambufs): Don't set eofbit. * testsuite/27_io/ostream_inserter_other.cc (test04): Add test. * testsuite/27_io/istream_extractor_other.cc: Fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43602 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc8
-rw-r--r--libstdc++-v3/testsuite/27_io/istream_extractor_other.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc17
4 files changed, 28 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 19bed9a51ab..2bb5f013c26 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2001-06-26 Benjamin Kosnik <bkoz@fillmore.constant.com>
+ <vakatov@ncbi.nlm.nih.gov>
+
+ libstdc++/3272
+ * include/bits/streambuf.tcc (__copy_streambufs): Don't set eofbit.
+ * testsuite/27_io/ostream_inserter_other.cc (test04): Add test.
+ * testsuite/27_io/istream_extractor_other.cc: Fix.
+
2001-06-26 Zoltan Hidvegi <hzoli@austin.ibm.com>
* acinclude.m4 (glibcpp_toolexeclibdir): Make multilib safe.
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index fc26232a32c..a21ad1cb9d7 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -206,12 +206,8 @@ namespace std {
__sbin->_M_in_cur_move(__xtrct);
if (__xtrct == __bufsize)
{
- int_type __c = __sbin->sgetc();
- if (__c == _Traits::eof())
- {
- __ios.setstate(ios_base::eofbit);
- break;
- }
+ if (__sbin->sgetc() == _Traits::eof())
+ break;
__bufsize = __sbin->in_avail();
}
else
diff --git a/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc b/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
index 01ae50d5d6c..c7053d1daad 100644
--- a/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
+++ b/libstdc++-v3/testsuite/27_io/istream_extractor_other.cc
@@ -128,9 +128,9 @@ bool test01() {
state1 = is_04.rdstate();
is_04 >> &isbuf_03;
state2 = is_04.rdstate();
- VERIFY( state1 != state2 );
+ VERIFY( state1 == state2 );
VERIFY( !static_cast<bool>(state2 & statefail) );
- VERIFY( state2 == stateeof );
+ VERIFY( state2 != stateeof );
strtmp = isbuf_03.str();
VERIFY( strtmp == str_02 ); // as only an "in" buffer
VERIFY( isbuf_03.sgetc() == 'a' );
diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
index 6b9c1c0aa45..6dfcfc7cdc7 100644
--- a/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
+++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_other.cc
@@ -1,7 +1,7 @@
// 1999-08-16 bkoz
// 1999-11-01 bkoz
-// Copyright (C) 1999, 2000 Free Software Foundation
+// Copyright (C) 1999, 2000, 2001 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -134,6 +134,21 @@ test03(void)
return 0;
}
+// libstdc++/3272
+void test04()
+{
+ using namespace std;
+ bool test = true;
+ istringstream istr("inside betty carter");
+ ostringstream ostr;
+ ostr << istr.rdbuf() << endl;
+
+ if (ostr.rdstate() & ios_base::eofbit)
+ test = false;
+
+ VERIFY( test );
+}
+
int
main()
{