summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-08 17:55:54 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-08 17:55:54 +0000
commit62a99be6b42f2d26e12e1f2f0a1fdf793884b41b (patch)
treec23e50eaf3aa77026b82b22399caa173f4232326
parent56826b58158ef6eb7bbcea03dfd15dbed65b9199 (diff)
downloadppe42-gcc-62a99be6b42f2d26e12e1f2f0a1fdf793884b41b.tar.gz
ppe42-gcc-62a99be6b42f2d26e12e1f2f0a1fdf793884b41b.zip
2004-11-08 Paolo Carlini <pcarlini@suse.de>
* include/bits/streambuf_iterator.h (class istreambuf_iterator): Consistently use _M_c to cache the current char, i.e., not only when operator++(int) is involved; change _M_c to mutable. (_M_get()): Always save the return value of _M_sbuf->sgetc() into _M_c. * testsuite/22_locale/time_get/get_monthname/char/1.cc: Fix (long standing) typo. * testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Likewise. * testsuite/22_locale/time_get/get_weekday/char/1.cc: Likewise. * testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90275 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog13
-rw-r--r--libstdc++-v3/include/bits/streambuf_iterator.h9
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc2
6 files changed, 22 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 62f996c11d9..86a8dcfd526 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,18 @@
2004-11-08 Paolo Carlini <pcarlini@suse.de>
+ * include/bits/streambuf_iterator.h (class istreambuf_iterator):
+ Consistently use _M_c to cache the current char, i.e., not only
+ when operator++(int) is involved; change _M_c to mutable.
+ (_M_get()): Always save the return value of _M_sbuf->sgetc() into
+ _M_c.
+ * testsuite/22_locale/time_get/get_monthname/char/1.cc: Fix
+ (long standing) typo.
+ * testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Likewise.
+ * testsuite/22_locale/time_get/get_weekday/char/1.cc: Likewise.
+ * testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Likewise.
+
+2004-11-08 Paolo Carlini <pcarlini@suse.de>
+
* include/bits/istream.tcc (getline(char_type*, streamsize,
char_type), ignore(streamsize), ignore(streamsize, int_type)):
Restore a generic version of the functions, not using the
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index 970933578c7..f378862ed14 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -72,7 +72,7 @@ namespace std
// NB: This implementation assumes the "end of stream" value
// is EOF, or -1.
mutable streambuf_type* _M_sbuf;
- int_type _M_c;
+ mutable int_type _M_c;
public:
/// Construct end of input stream iterator.
@@ -157,10 +157,11 @@ namespace std
int_type __ret = __eof;
if (_M_sbuf)
{
- if (!traits_type::eq_int_type(_M_c, __eof))
+ if (!traits_type::eq_int_type(_M_c, __eof)
+ || !traits_type::eq_int_type((_M_c = _M_sbuf->sgetc()),
+ __eof))
__ret = _M_c;
- else if (traits_type::eq_int_type((__ret = _M_sbuf->sgetc()),
- __eof))
+ else
_M_sbuf = 0;
}
return __ret;
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
index 5d314613f9f..b96007b22c9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc
@@ -102,7 +102,7 @@ void test01()
tim_get.get_monthname(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_mon == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == 'l');
+ VERIFY( *is_it06 == 'l');
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
index c5c51a38dee..9eb219f3cd9 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
@@ -102,7 +102,7 @@ void test01()
tim_get.get_monthname(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_mon == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == L'l' );
+ VERIFY( *is_it06 == L'l' );
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
index 85565e87853..1d6da0a8ab1 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc
@@ -106,7 +106,7 @@ void test01()
tim_get.get_weekday(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_wday == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == 'u');
+ VERIFY( *is_it06 == 'u');
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
index 67efe266847..1852b9b39ee 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
@@ -106,7 +106,7 @@ void test01()
tim_get.get_weekday(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_wday == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == L'u' );
+ VERIFY( *is_it06 == L'u' );
}
int main()
OpenPOWER on IntegriCloud