This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/943/2985/2970
- To: gcc-patches at gcc dot gnu dot org
- Subject: [v3] libstdc++/943/2985/2970
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Thu, 31 May 2001 05:13:09 -0700
Turned out to be major surgery.
Iostreams had been tested with non-standard _CharT parameters, but not
_Traits. This is fixed now.
The locale facet caching strategy had to be tweaked, now the library
only caches facets that exist. Sounds existential, but what it means
is that now creation and initalization of iostreams doesn't mandate
the global locale to have the facets necessary for all operations at
init time. Instead, it's first use. This is as it should be, and gives
the end user time to imbue with the proper locales.
Removes a bunch of old complex config tests.
Lots of problems with typedefs found and fixed throughout the
iostreams hierarchy.
-benjamin
2001-05-30 Benjamin Kosnik <bkoz@redat.com>
* acconfig.h (_GLIBCPP_BUGGY_FLOAT_COMPLEX): Remove.
(_GLIBCPP_BUGGY_COMPLEX): Remove.
* config.h.in: Regenerate.
* acinclude.m4 (GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT): Remove.
* aclocal.m4: Regenerate.
* configure.in: Don't call it.
* configure: Regenerate.
libstdc++/2970
* src/complex_io.cc (operator<<(ostream&, const complex&): Fix.
* testsuite/26_numerics/complex_inserters_extractors.cc (test01):
New test.
libstdc++/2985
* include/bits/std_complex.h: Include sstream. Put definitions for
complex inserters and extractors here, and remove them from...
* src/complex_io.cc: ...here.
* include/bits/basic_ios.h (basic_ios::__numput_type): Add _Traits
parameter.
(basic_ios::__numget_type): Same.
* include/bits/std_istream.h: Same.
* include/bits/std_ostream.h: Same.
* include/bits/sbuf_iter.h (ostreambuf_iterator): Fix typo in base
class iterator template arguments.
* src/locale-inst.cc: Add explicit has_facet instantiations.
* include/bits/basic_ios.h (basic_ios::_M_get_fctype_ios): Remove.
(_M_get_fnumput): Remove.
(_M_get_fnumget): Remove.
(basic_ios::_M_check_facet): New function.
(basic_ios::_M_cache_facets): New function.
* include/bits/basic_ios.tcc: Definition for _M_cache_facets.
(basic_ios::imbue): Call _M_cache_facets.
(basic_ios::init): Same.
* include/bits/istream.tcc: Format, use _M_check_facet.
* include/bits/ostream.tcc: Same.
* include/bits/locale_facets.tcc (__output_float): Change
signature, add _Traits.
* testsuite/26_numerics/complex_inserters_extractors.cc (test02):
New test.
Index: acconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acconfig.h,v
retrieving revision 1.17
diff -c -p -r1.17 acconfig.h
*** acconfig.h 2001/04/26 02:23:51 1.17
--- acconfig.h 2001/05/31 11:59:28
***************
*** 1,11 ****
// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
- // Define if GCC support for __complex__ float is buggy.
- #undef _GLIBCPP_BUGGY_FLOAT_COMPLEX
-
- // Define if GCC support for __complex__ is buggy.
- #undef _GLIBCPP_BUGGY_COMPLEX
-
// Include support for multiple threads, e.g., in the I/O package.
#undef _GLIBCPP_USE_THREADS
--- 1,5 ----
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.149
diff -c -p -r1.149 acinclude.m4
*** acinclude.m4 2001/05/30 17:05:01 1.149
--- acinclude.m4 2001/05/31 11:59:33
*************** AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT,
*** 864,938 ****
dnl
- dnl Check to see if this version of GNU C++ is afflicted by bugs in
- dnl __complex__ float support.
- dnl
- dnl Define _GLIBCPP_BUGGY_FLOAT_COMPLEX if buggy.
- dnl
- dnl Check to see if this version of GNU C++ is afflicted by bugs in
- dnl __complex__ support.Check for buggy __complex__ that will cause ICE in
- dnl gcc-2.95.x when using the library, unless we define the default copy
- dnl ctor in the specializations of complex<>.
- dnl
- dnl Define _GLIBCPP_BUGGY_COMPLEX if buggy.
- dnl GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
- AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
- AC_REQUIRE([AC_PROG_CXX])
-
- AC_MSG_CHECKING([for GNU C++ __complex__ support])
- AC_CACHE_VAL(glibcpp_cv_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
- dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
- [ dcomplex x; f(x); ],
- glibcpp_cv_complex=ok,
- glibcpp_cv_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_complex)
- if test $glibcpp_cv_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
- fi
-
- AC_MSG_CHECKING([for GNU C++ __complex__ float support])
- AC_CACHE_VAL(glibcpp_cv_float_complex, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- rm -f conftest.h
- cat > conftest.h <<EOB
- //
- // Check for buggy __complex__ that causes ICE in most versions of egcs
- // and gcc-2.95.x on certain platforms (eg., x86-win32).
- //
- // See http://gcc.gnu.org/ml/gcc-bugs/1999-07n/msg00845.html for
- // more info on the bug itself.
- //
- struct
- float_complex
- {
- __complex__ float m_value;
- float_complex (float = 0.0f, float = 0.0f);
- float_complex (__complex__ float val) : m_value (val) {}
- float_complex foo (const float_complex &val)
- { return float_complex (~val.m_value); }
- };
- EOB
- AC_TRY_COMPILE([#include "conftest.h"], ,
- glibcpp_cv_float_complex=ok,
- glibcpp_cv_float_complex=buggy
- )
- AC_LANG_RESTORE
- ])
- AC_MSG_RESULT($glibcpp_cv_float_complex)
- if test $glibcpp_cv_float_complex = buggy; then
- AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
- fi
- ])
-
-
- dnl
dnl Check for special debugging mode; not for production use.
dnl
dnl GLIBCPP_ENABLE_DEBUG
--- 864,869 ----
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.61
diff -c -p -r1.61 configure.in
*** configure.in 2001/05/14 01:15:33 1.61
--- configure.in 2001/05/31 12:00:16
*************** if test -n "$with_cross_host"; then
*** 169,175 ****
AC_DEFINE(HAVE_TANHL)
fi
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
GLIBCPP_CHECK_WCHAR_T_SUPPORT
os_include_dir="config/os/gnu-linux"
# GLIBCPP_CHECK_STDLIB_SUPPORT
--- 169,174 ----
*************** if test -n "$with_cross_host"; then
*** 189,196 ****
os_include_dir="config/os/newlib"
- AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
- AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
# need to check for faster f versions of math functions, ie sinf?
;;
esac
--- 188,193 ----
*************** else
*** 213,219 ****
GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
GLIBCPP_CHECK_MATH_SUPPORT
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
- GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
GLIBCPP_CHECK_WCHAR_T_SUPPORT
GLIBCPP_CHECK_STDLIB_SUPPORT
--- 210,215 ----
Index: include/bits/basic_ios.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_ios.h,v
retrieving revision 1.5
diff -c -p -r1.5 basic_ios.h
*** basic_ios.h 2001/03/04 21:34:00 1.5
--- basic_ios.h 2001/05/31 12:00:17
***************
*** 35,48 ****
#include <bits/sbuf_iter.h>
#include <bits/locale_facets.h>
! namespace std {
!
// 27.4.5 Template class basic_ios
template<typename _CharT, typename _Traits>
class basic_ios : public ios_base
{
public:
-
// Types:
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
--- 35,47 ----
#include <bits/sbuf_iter.h>
#include <bits/locale_facets.h>
! namespace std
! {
// 27.4.5 Template class basic_ios
template<typename _CharT, typename _Traits>
class basic_ios : public ios_base
{
public:
// Types:
typedef _CharT char_type;
typedef typename _Traits::int_type int_type;
*************** namespace std {
*** 51,61 ****
typedef _Traits traits_type;
// Non-standard Types:
! typedef ctype<_CharT> __ctype_type;
! // From ostream
! typedef ostreambuf_iterator<_CharT> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
! typedef istreambuf_iterator<_CharT> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
// Data members:
--- 50,59 ----
typedef _Traits traits_type;
// Non-standard Types:
! typedef ctype<_CharT> __ctype_type;
! typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
! typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
// Data members:
*************** namespace std {
*** 76,94 ****
const __numget_type* _M_fnumget;
public:
-
inline const __ctype_type*
_M_get_fctype_ios(void)
{ return _M_ios_fctype; }
- inline const __numget_type*
- _M_get_fnumget(void)
- { return _M_fnumget; }
-
- inline const __numput_type*
- _M_get_fnumput(void)
- { return _M_fnumput; }
-
operator void*() const
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
--- 74,83 ----
*************** namespace std {
*** 202,209 ****
void
init(basic_streambuf<_CharT, _Traits>* __sb);
};
-
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
--- 191,211 ----
void
init(basic_streambuf<_CharT, _Traits>* __sb);
+
+ bool
+ _M_check_facet(const locale::facet* __f)
+ {
+ bool __ret = false;
+ if (__f)
+ __ret = true;
+ else
+ __throw_bad_cast();
+ return __ret;
+ }
+
+ void
+ _M_cache_facets(const locale& __loc);
};
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
Index: include/bits/basic_ios.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_ios.tcc,v
retrieving revision 1.5
diff -c -p -r1.5 basic_ios.tcc
*** basic_ios.tcc 2001/05/24 23:09:52 1.5
--- basic_ios.tcc 2001/05/31 12:00:18
*************** namespace std {
*** 105,113 ****
{
locale __old(this->getloc());
ios_base::imbue(__loc);
! _M_ios_fctype = &use_facet<__ctype_type>(__loc);
! _M_fnumput = &use_facet<__numput_type>(__loc);
! _M_fnumget = &use_facet<__numget_type>(__loc);
if (this->rdbuf() != 0)
this->rdbuf()->pubimbue(__loc);
return __old;
--- 105,111 ----
{
locale __old(this->getloc());
ios_base::imbue(__loc);
! _M_cache_facets(__loc);
if (this->rdbuf() != 0)
this->rdbuf()->pubimbue(__loc);
return __old;
*************** namespace std {
*** 119,128 ****
{
// NB: This may be called more than once on the same object.
ios_base::_M_init();
! _M_ios_fctype = &use_facet<__ctype_type>(_M_ios_locale);
! // Should be filled in by ostream and istream, respectively.
! _M_fnumput = &use_facet<__numput_type>(_M_ios_locale);
! _M_fnumget = &use_facet<__numget_type>(_M_ios_locale);
_M_tie = 0;
_M_fill = this->widen(' ');
_M_exception = goodbit;
--- 117,123 ----
{
// NB: This may be called more than once on the same object.
ios_base::_M_init();
! _M_cache_facets(_M_ios_locale);
_M_tie = 0;
_M_fill = this->widen(' ');
_M_exception = goodbit;
*************** namespace std {
*** 130,137 ****
--- 125,145 ----
_M_streambuf_state = __sb ? goodbit : badbit;
}
+ template<typename _CharT, typename _Traits>
+ void
+ basic_ios<_CharT, _Traits>::_M_cache_facets(const locale& __loc)
+ {
+ if (has_facet<__ctype_type>(__loc))
+ _M_ios_fctype = &use_facet<__ctype_type>(__loc);
+ // Should be filled in by ostream and istream, respectively.
+ if (has_facet<__numput_type>(__loc))
+ _M_fnumput = &use_facet<__numput_type>(__loc);
+ if (has_facet<__numget_type>(__loc))
+ _M_fnumget = &use_facet<__numget_type>(__loc);
+ }
} // namespace std
#endif // _CPP_BITS_BASICIOS_TCC
+
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.13
diff -c -p -r1.13 istream.tcc
*** istream.tcc 2001/05/08 03:07:56 1.13
--- istream.tcc 2001/05/31 12:00:21
***************
*** 31,38 ****
#include <bits/std_locale.h>
! namespace std {
!
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
--- 31,38 ----
#include <bits/std_locale.h>
! namespace std
! {
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
*************** namespace std {
*** 103,120 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 103,123 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 127,144 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 130,150 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 151,168 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 157,177 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 175,192 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 184,204 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 199,216 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 211,231 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 223,240 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 238,258 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 247,264 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 265,285 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 272,289 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
! }
}
return *this;
}
--- 293,313 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
__throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 296,313 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 320,340 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 321,338 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 348,368 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 345,362 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 375,395 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 369,386 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 402,422 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 393,410 ****
sentry __cerb(*this, false);
if (__cerb)
{
! try {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 429,449 ----
sentry __cerb(*this, false);
if (__cerb)
{
! try
! {
! ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
! if (_M_check_facet(_M_fnumget))
! _M_fnumget->get(*this, 0, *this, __err, __n);
! this->setstate(__err);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 435,455 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! __c = this->rdbuf()->sbumpc();
! // 27.6.1.1 paragraph 3
! if (__c != __eof)
! _M_gcount = 1;
! else
! this->setstate(ios_base::eofbit | ios_base::failbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __c;
}
--- 474,496 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! __c = this->rdbuf()->sbumpc();
! // 27.6.1.1 paragraph 3
! if (__c != __eof)
! _M_gcount = 1;
! else
! this->setstate(ios_base::eofbit | ios_base::failbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __c;
}
*************** namespace std {
*** 463,487 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! const int_type __eof = traits_type::eof();
! int_type __bufval = this->rdbuf()->sbumpc();
! // 27.6.1.1 paragraph 3
! if (__bufval != __eof)
! {
! _M_gcount = 1;
! __c = traits_type::to_char_type(__bufval);
! }
! else
! this->setstate(ios_base::eofbit | ios_base::failbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 504,530 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! const int_type __eof = traits_type::eof();
! int_type __bufval = this->rdbuf()->sbumpc();
! // 27.6.1.1 paragraph 3
! if (__bufval != __eof)
! {
! _M_gcount = 1;
! __c = traits_type::to_char_type(__bufval);
! }
! else
! this->setstate(ios_base::eofbit | ios_base::failbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 495,528 ****
sentry __cerb(*this, true);
if (__cerb && __n > 1)
{
! try {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
!
! while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
! {
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if (__testdelim || _M_gcount == __n - 1)
! __sb->sputbackc(__c);
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
*__s = char_type(NULL);
if (!_M_gcount)
--- 538,573 ----
sentry __cerb(*this, true);
if (__cerb && __n > 1)
{
! try
! {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
!
! while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
! {
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if (__testdelim || _M_gcount == __n - 1)
! __sb->sputbackc(__c);
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
*__s = char_type(NULL);
if (!_M_gcount)
*************** namespace std {
*** 541,572 ****
{
int_type __c;
__streambuf_type* __this_sb = this->rdbuf();
! try {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __c = __this_sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
! bool __testput = true;
!
! while (!__testeof && !__testdelim
! && (__testput = __sb.sputc(traits_type::to_char_type(__c))
! != __eof))
! {
! ++_M_gcount;
! __c = __this_sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if (__testdelim || !__testput)
__this_sb->sputbackc(traits_type::to_char_type(__c));
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail){
! // Exception may result from sputc->overflow.
! __this_sb->sputbackc(traits_type::to_char_type(__c));
! }
}
if (!_M_gcount)
this->setstate(ios_base::failbit);
--- 586,619 ----
{
int_type __c;
__streambuf_type* __this_sb = this->rdbuf();
! try
! {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __c = __this_sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
! bool __testput = true;
!
! while (!__testeof && !__testdelim
! && (__testput = __sb.sputc(traits_type::to_char_type(__c))
! != __eof))
! {
! ++_M_gcount;
! __c = __this_sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if (__testdelim || !__testput)
! __this_sb->sputbackc(traits_type::to_char_type(__c));
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail)
! {
! // Exception may result from sputc->overflow.
__this_sb->sputbackc(traits_type::to_char_type(__c));
! }
}
if (!_M_gcount)
this->setstate(ios_base::failbit);
*************** namespace std {
*** 582,624 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! ++_M_gcount;
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
!
! while (_M_gcount < __n && !__testeof && !__testdelim)
! {
! *__s++ = traits_type::to_char_type(__c);
! __c = __sb->sbumpc();
! ++_M_gcount;
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if (__testeof)
! {
! --_M_gcount;
! this->setstate(ios_base::eofbit);
! }
! else if (!__testdelim)
! {
! --_M_gcount;
! __sb->sputbackc(traits_type::to_char_type(__c));
! this->setstate(ios_base::failbit);
! }
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
*__s = char_type(NULL);
if (!_M_gcount)
--- 629,673 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! ++_M_gcount;
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
! while (_M_gcount < __n && !__testeof && !__testdelim)
! {
! *__s++ = traits_type::to_char_type(__c);
! __c = __sb->sbumpc();
! ++_M_gcount;
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
!
! if (__testeof)
! {
! --_M_gcount;
! this->setstate(ios_base::eofbit);
! }
! else if (!__testdelim)
! {
! --_M_gcount;
! __sb->sputbackc(traits_type::to_char_type(__c));
! this->setstate(ios_base::failbit);
! }
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
*__s = char_type(NULL);
if (!_M_gcount)
*************** namespace std {
*** 635,668 ****
sentry __cerb(*this, true);
if (__cerb && __n > 0)
{
! try {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
!
! __n = min(__n, numeric_limits<streamsize>::max());
! while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
! {
++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if ((_M_gcount == __n - 1 && !__testeof) || __testdelim)
! ++_M_gcount;
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 684,719 ----
sentry __cerb(*this, true);
if (__cerb && __n > 0)
{
! try
! {
! const int_type __idelim = traits_type::to_int_type(__delim);
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testdelim = __c == __idelim;
! bool __testeof = __c == __eof;
!
! __n = min(__n, numeric_limits<streamsize>::max());
! while (_M_gcount < __n - 1 && !__testeof && !__testdelim)
! {
! ++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testdelim = __c == __idelim;
! }
! if ((_M_gcount == __n - 1 && !__testeof) || __testdelim)
++_M_gcount;
! if (__testeof)
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 677,692 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! __c = this->rdbuf()->sgetc();
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __c;
}
--- 728,743 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! { __c = this->rdbuf()->sgetc(); }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __c;
}
*************** namespace std {
*** 702,736 ****
{
if (__n > 0)
{
! try {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testeof = __c == __eof;
!
! while (_M_gcount < __n - 1 && !__testeof)
! {
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! }
! if (__testeof)
! this->setstate(ios_base::eofbit | ios_base::failbit);
! else
! {
! // _M_gcount == __n - 1
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! }
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
}
else
--- 753,789 ----
{
if (__n > 0)
{
! try
! {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! int_type __c = __sb->sbumpc();
! bool __testeof = __c == __eof;
!
! while (_M_gcount < __n - 1 && !__testeof)
! {
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! }
! if (__testeof)
! this->setstate(ios_base::eofbit | ios_base::failbit);
! else
! {
! // _M_gcount == __n - 1
! *__s++ = traits_type::to_char_type(__c);
! ++_M_gcount;
! }
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
}
else
*************** namespace std {
*** 750,773 ****
{
if (__n > 0)
{
! try {
! streamsize __num = this->rdbuf()->in_avail();
! if (__num != static_cast<streamsize>(__eof))
! {
! __num = min(__num, __n);
! _M_gcount = this->rdbuf()->sgetn(__s, __num);
! }
! else
! this->setstate(ios_base::eofbit);
! }
!
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
}
else
--- 803,827 ----
{
if (__n > 0)
{
! try
! {
! streamsize __num = this->rdbuf()->in_avail();
! if (__num != static_cast<streamsize>(__eof))
! {
! __num = min(__num, __n);
! _M_gcount = this->rdbuf()->sgetn(__s, __num);
! }
! else
! this->setstate(ios_base::eofbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
}
else
*************** namespace std {
*** 783,801 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __sb->sputbackc(__c) == __eof)
! this->setstate(ios_base::badbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
this->setstate(ios_base::failbit);
--- 837,857 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __sb->sputbackc(__c) == __eof)
! this->setstate(ios_base::badbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
this->setstate(ios_base::failbit);
*************** namespace std {
*** 811,829 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __eof == __sb->sungetc())
! this->setstate(ios_base::badbit);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
this->setstate(ios_base::failbit);
--- 867,887 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! const int_type __eof = traits_type::eof();
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __eof == __sb->sungetc())
! this->setstate(ios_base::badbit);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
this->setstate(ios_base::failbit);
*************** namespace std {
*** 840,859 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __ret == __sb->pubsync())
! this->setstate(ios_base::badbit);
! else
! __ret = 0;
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __ret;
}
--- 898,919 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! __streambuf_type* __sb = this->rdbuf();
! if (!__sb || __ret == __sb->pubsync())
! this->setstate(ios_base::badbit);
! else
! __ret = 0;
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __ret;
}
*************** namespace std {
*** 868,883 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
! __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __ret;
}
--- 928,945 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
! __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return __ret;
}
*************** namespace std {
*** 892,910 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekpos(__pos, ios_base::in);
#endif
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 954,974 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekpos(__pos, ios_base::in);
#endif
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 918,936 ****
sentry __cerb(*this, true);
if (__cerb)
{
! try {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekoff(__off, __dir, ios_base::in);
#endif
! }
! catch(exception& __fail){
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
--- 982,1002 ----
sentry __cerb(*this, true);
if (__cerb)
{
! try
! {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekoff(__off, __dir, ios_base::in);
#endif
! }
! catch(exception& __fail)
! {
! // 27.6.1.3 paragraph 1
! // Turn this on without causing an ios::failure to be thrown.
! this->setstate(ios_base::badbit);
! if ((this->exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
return *this;
}
*************** namespace std {
*** 944,959 ****
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
! try {
! __in.get(__c);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! __in.setstate(ios_base::badbit);
! if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
__in.setstate(ios_base::failbit);
--- 1010,1025 ----
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
! try
! { __in.get(__c); }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! __in.setstate(ios_base::badbit);
! if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
else
__in.setstate(ios_base::failbit);
*************** namespace std {
*** 974,1019 ****
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
! try {
! // Figure out how many characters to extract.
! streamsize __num = __in.width();
! if (__num == 0)
! __num = numeric_limits<streamsize>::max();
!
! __streambuf_type* __sb = __in.rdbuf();
! const __ctype_type* __ctype = __in._M_get_fctype_ios();
! int_type __c = __sb->sbumpc();
! const int_type __eof = _Traits::eof();
! bool __testsp = __ctype->is(ctype_base::space, __c);
! bool __testeof = __c == __eof;
!
! while (__extracted < __num - 1 && !__testeof && !__testsp)
! {
! *__s++ = __c;
! ++__extracted;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testsp = __ctype->is(ctype_base::space, __c);
! }
!
! if (!__testeof)
! __sb->sputbackc(__c);
! else
! __in.setstate(ios_base::eofbit);
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//68. Extractors for char* should store null at end
! *__s = char_type();
#endif
! __in.width(0);
! }
! catch(exception& __fail){
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! __in.setstate(ios_base::badbit);
! if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
if (!__extracted)
__in.setstate(ios_base::failbit);
--- 1040,1087 ----
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
! try
! {
! // Figure out how many characters to extract.
! streamsize __num = __in.width();
! if (__num == 0)
! __num = numeric_limits<streamsize>::max();
!
! __streambuf_type* __sb = __in.rdbuf();
! const __ctype_type* __ctype = __in._M_get_fctype_ios();
! int_type __c = __sb->sbumpc();
! const int_type __eof = _Traits::eof();
! bool __testsp = __ctype->is(ctype_base::space, __c);
! bool __testeof = __c == __eof;
!
! while (__extracted < __num - 1 && !__testeof && !__testsp)
! {
! *__s++ = __c;
! ++__extracted;
! __c = __sb->sbumpc();
! __testeof = __c == __eof;
! __testsp = __ctype->is(ctype_base::space, __c);
! }
!
! if (!__testeof)
! __sb->sputbackc(__c);
! else
! __in.setstate(ios_base::eofbit);
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//68. Extractors for char* should store null at end
! *__s = char_type();
#endif
! __in.width(0);
! }
! catch(exception& __fail)
! {
! // 27.6.1.2.1 Common requirements.
! // Turn this on without causing an ios::failure to be thrown.
! __in.setstate(ios_base::badbit);
! if ((__in.exceptions() & ios_base::badbit) != 0)
! __throw_exception_again;
! }
}
if (!__extracted)
__in.setstate(ios_base::failbit);
*************** namespace std {
*** 1153,1159 ****
getline(basic_istream<_CharT, _Traits>& __in,
basic_string<_CharT,_Traits,_Alloc>& __str)
{ return getline(__in, __str, __in.widen('\n')); }
-
} // namespace std
// Local Variables:
--- 1221,1226 ----
Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.13
diff -c -p -r1.13 locale_facets.tcc
*** locale_facets.tcc 2001/05/08 03:07:56 1.13
--- locale_facets.tcc 2001/05/31 12:00:24
*************** namespace std
*** 964,970 ****
#endif
// Generic helper function
! template<typename _CharT, typename _OutIter>
_OutIter
__output_float(_OutIter __s, ios_base& __io, _CharT __fill,
const char* __sptr, size_t __slen)
--- 964,970 ----
#endif
// Generic helper function
! template<typename _CharT, typename _Traits, typename _OutIter>
_OutIter
__output_float(_OutIter __s, ios_base& __io, _CharT __fill,
const char* __sptr, size_t __slen)
*************** namespace std
*** 974,983 ****
}
// Partial specialization for ostreambuf_iterator.
! template<typename _CharT>
! ostreambuf_iterator<_CharT>
! __output_float(ostreambuf_iterator<_CharT> __s, ios_base& __io,
! _CharT __fill, const char* __sptr, size_t __slen)
{
size_t __padding = __io.width() > streamsize(__slen) ?
__io.width() -__slen : 0;
--- 974,983 ----
}
// Partial specialization for ostreambuf_iterator.
! template<typename _CharT, typename _Traits>
! ostreambuf_iterator<_CharT, _Traits>
! __output_float(ostreambuf_iterator<_CharT, _Traits> __s, ios_base& __io,
! _CharT __fill, const char* __sptr, size_t __slen)
{
size_t __padding = __io.width() > streamsize(__slen) ?
__io.width() -__slen : 0;
*************** namespace std
*** 1037,1043 ****
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
! char __sbuf[__max_prec*2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
--- 1037,1043 ----
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
! char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
*************** namespace std
*** 1061,1067 ****
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
! char __sbuf[__max_prec*2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
--- 1061,1067 ----
if (__prec > __max_prec)
__prec = __max_prec;
// The *2 provides for signs, exp, 'E', and pad.
! char __sbuf[__max_prec * 2];
size_t __slen;
// Long enough for the max format spec.
char __fbuf[16];
Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.10
diff -c -p -r1.10 ostream.tcc
*** ostream.tcc 2001/05/25 04:23:45 1.10
--- ostream.tcc 2001/05/31 12:00:25
*************** namespace std
*** 118,125 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 118,126 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
*************** namespace std
*** 142,157 ****
{
try
{
! bool __f;
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
! if (__fmt & ios_base::oct || __fmt & ios_base::hex)
! __f = _M_fnumput->put(*this, *this, this->fill(),
! static_cast<unsigned long>(__n)).failed();
! else
! __f = _M_fnumput->put(*this, *this, this->fill(), __n).failed();
!
! if (__f)
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 143,163 ----
{
try
{
! char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
! if (_M_check_facet(_M_fnumput))
! {
! bool __b = false;
! if (__fmt & ios_base::oct || __fmt & ios_base::hex)
! {
! unsigned long __l = static_cast<unsigned long>(__n);
! __b = _M_fnumput->put(*this, *this, __c, __l).failed();
! }
! else
! __b = _M_fnumput->put(*this, *this, __c, __n).failed();
! if (__b)
! this->setstate(ios_base::badbit);
! }
}
catch(exception& __fail)
{
*************** namespace std
*** 174,181 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 180,188 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
*************** namespace std
*** 199,213 ****
{
try
{
! bool __f;
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
! if (__fmt & ios_base::oct || __fmt & ios_base::hex)
! __f = _M_fnumput->put(*this, *this, this->fill(),
! static_cast<unsigned long long>(__n)).failed();
! else
! __f = _M_fnumput->put(*this, *this, this->fill(), __n).failed();
! if (__f)
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 206,227 ----
{
try
{
! char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
! if (_M_check_facet(_M_fnumput))
! {
! bool __b = false;
! if (__fmt & ios_base::oct || __fmt & ios_base::hex)
! {
! unsigned long long __l;
! __l = static_cast<unsigned long long>(__n);
! __b = _M_fnumput->put(*this, *this, __c, __l).failed();
! }
! else
! __b = _M_fnumput->put(*this, *this, __c, __n).failed();
! if (__b)
! this->setstate(ios_base::badbit);
! }
}
catch(exception& __fail)
{
*************** namespace std
*** 230,237 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 244,252 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
*************** namespace std
*** 255,262 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 270,278 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
*************** namespace std
*** 279,286 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 295,303 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
*************** namespace std
*** 303,310 ****
{
try
{
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
--- 320,328 ----
{
try
{
! if (_M_check_facet(_M_fnumput))
! if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
! this->setstate(ios_base::badbit);
}
catch(exception& __fail)
{
Index: include/bits/sbuf_iter.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/sbuf_iter.h,v
retrieving revision 1.7
diff -c -p -r1.7 sbuf_iter.h
*** sbuf_iter.h 2001/05/08 03:07:56 1.7
--- sbuf_iter.h 2001/05/31 12:00:26
*************** namespace std
*** 38,44 ****
{
template<typename _CharT, typename _Traits>
class ostreambuf_iterator
! : public iterator<output_iterator_tag, _CharT, void, void, void>
{
public:
// Types:
--- 38,44 ----
{
template<typename _CharT, typename _Traits>
class ostreambuf_iterator
! : public iterator<output_iterator_tag, void, void, void, void>
{
public:
// Types:
Index: include/bits/std_complex.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_complex.h,v
retrieving revision 1.16
diff -c -p -r1.16 std_complex.h
*** std_complex.h 2001/02/19 18:52:25 1.16
--- std_complex.h 2001/05/31 12:00:28
***************
*** 41,51 ****
#include <bits/c++config.h>
#include <bits/std_cmath.h>
! #include <bits/std_iosfwd.h>
namespace std
{
-
// Forward declarations
template<typename _Tp> class complex;
template<> class complex<float>;
--- 41,50 ----
#include <bits/c++config.h>
#include <bits/std_cmath.h>
! #include <bits/std_sstream.h>
namespace std
{
// Forward declarations
template<typename _Tp> class complex;
template<> class complex<float>;
*************** namespace std
*** 346,356 ****
template<typename _Tp, typename _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
! operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&);
template<typename _Tp, typename _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
! operator<<(basic_ostream<_CharT, _Traits>&, const complex<_Tp>&);
// Values
template<typename _Tp>
--- 345,391 ----
template<typename _Tp, typename _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
! operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
! {
! _Tp __re_x, __im_x;
! _CharT __ch;
! __is >> __ch;
! if (__ch == '(')
! {
! __is >> __re_x >> __ch;
! if (__ch == ',')
! {
! __is >> __im_x >> __ch;
! if (__ch == ')')
! __x = complex<_Tp>(__re_x, __im_x);
! else
! __is.setstate(ios_base::failbit);
! }
! else if (__ch == ')')
! __x = complex<_Tp>(__re_x, _Tp(0));
! else
! __is.setstate(ios_base::failbit);
! }
! else
! {
! __is.putback(__ch);
! __is >> __re_x;
! __x = complex<_Tp>(__re_x, _Tp(0));
! }
! return __is;
! }
template<typename _Tp, typename _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
! operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
! {
! basic_ostringstream<_CharT, _Traits> __s;
! __s.flags(__os.flags());
! __s.imbue(__os.getloc());
! __s.precision(__os.precision());
! __s << '(' << __x.real() << "," << __x.imag() << ')';
! return __os << __s.str();
! }
// Values
template<typename _Tp>
Index: include/bits/std_iosfwd.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_iosfwd.h,v
retrieving revision 1.5
diff -c -p -r1.5 std_iosfwd.h
*** std_iosfwd.h 2001/03/07 22:22:41 1.5
--- std_iosfwd.h 2001/05/31 12:00:28
*************** namespace std
*** 129,131 ****
--- 129,136 ----
} // namespace std
#endif // _CPP_IOSFWD
+
+
+
+
+
Index: include/bits/std_istream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_istream.h,v
retrieving revision 1.4
diff -c -p -r1.4 std_istream.h
*** std_istream.h 2001/03/04 21:34:00 1.4
--- std_istream.h 2001/05/31 12:00:29
***************
*** 41,47 ****
namespace std
{
-
// 27.6.1.1 Template class basic_istream
template<typename _CharT, typename _Traits>
class basic_istream : virtual public basic_ios<_CharT, _Traits>
--- 41,46 ----
*************** namespace std
*** 59,65 ****
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
! typedef istreambuf_iterator<_CharT> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
typedef ctype<_CharT> __ctype_type;
--- 58,64 ----
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_istream<_CharT, _Traits> __istream_type;
! typedef istreambuf_iterator<_CharT, _Traits> __istreambuf_iter;
typedef num_get<_CharT, __istreambuf_iter> __numget_type;
typedef ctype<_CharT> __ctype_type;
*************** namespace std
*** 78,87 ****
virtual
~basic_istream()
! {
! _M_gcount = streamsize(0);
! _M_fnumget = NULL;
! }
// 27.6.1.1.2 Prefix/suffix:
class sentry;
--- 77,83 ----
virtual
~basic_istream()
! { _M_gcount = streamsize(0); }
// 27.6.1.1.2 Prefix/suffix:
class sentry;
*************** namespace std
*** 289,295 ****
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
ws(basic_istream<_CharT, _Traits>& __is);
-
} // namespace std
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
--- 285,290 ----
Index: include/bits/std_ostream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_ostream.h,v
retrieving revision 1.6
diff -c -p -r1.6 std_ostream.h
*** std_ostream.h 2001/03/27 03:48:16 1.6
--- std_ostream.h 2001/05/31 12:00:30
*************** namespace std
*** 57,63 ****
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
! typedef ostreambuf_iterator<_CharT> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef ctype<_CharT> __ctype_type;
--- 57,63 ----
typedef basic_streambuf<_CharT, _Traits> __streambuf_type;
typedef basic_ios<_CharT, _Traits> __ios_type;
typedef basic_ostream<_CharT, _Traits> __ostream_type;
! typedef ostreambuf_iterator<_CharT, _Traits> __ostreambuf_iter;
typedef num_put<_CharT, __ostreambuf_iter> __numput_type;
typedef ctype<_CharT> __ctype_type;
*************** namespace std
*** 67,74 ****
{ this->init(__sb); }
virtual
! ~basic_ostream()
! { _M_fnumput = NULL; }
// 27.6.2.3 Prefix/suffix:
class sentry;
--- 67,73 ----
{ this->init(__sb); }
virtual
! ~basic_ostream() { }
// 27.6.2.3 Prefix/suffix:
class sentry;
Index: include/bits/std_streambuf.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_streambuf.h,v
retrieving revision 1.9
diff -c -p -r1.9 std_streambuf.h
*** std_streambuf.h 2001/05/08 03:07:56 1.9
--- std_streambuf.h 2001/05/31 12:00:31
*************** namespace std
*** 277,283 ****
_M_buf_size_opt = 0;
_M_mode = ios_base::openmode(0);
_M_buf_locale_init = false;
-
}
// Locales:
--- 277,282 ----
Index: src/complex_io.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/complex_io.cc,v
retrieving revision 1.5
diff -c -p -r1.5 complex_io.cc
*** complex_io.cc 2001/03/04 21:34:02 1.5
--- complex_io.cc 2001/05/31 12:00:32
***************
*** 1,6 ****
// The template and inlines for the -*- C++ -*- complex number classes.
! // Copyright (C) 2000 Free Software Foundation, Inc.
//
// 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
--- 1,6 ----
// The template and inlines for the -*- C++ -*- complex number classes.
! // Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// 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
***************
*** 28,93 ****
// the GNU General Public License.
#include <bits/std_complex.h>
- #include <bits/std_istream.h>
- #include <bits/std_ostream.h>
- #include <bits/std_sstream.h>
namespace std
{
-
- template<typename _Tp, typename _CharT, class _Traits>
- basic_istream <_CharT, _Traits> &
- operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
- {
- #if !defined(_GLIBCPP_BUGGY_FLOAT_COMPLEX) && !defined(_GLIBCPP_BUGGY_COMPLEX)
- _Tp __re_x, __im_x;
- _CharT __ch;
- __is >> __ch;
- if (__ch == '(')
- {
- __is >> __re_x >> __ch;
- if (__ch == ',')
- {
- __is >> __im_x >> __ch;
- if (__ch == ')')
- {
- __x = complex<_Tp>(__re_x, __im_x);
- return __is;
- }
- }
- else if (__ch == ')')
- {
- __x = complex<_Tp>(__re_x, _Tp(0));
- return __is;
- }
- }
- else
- {
- __is.putback(__ch);
- __is >> __re_x;
- __x = complex<_Tp>(__re_x, _Tp(0));
- return __is;
- }
- __is.setstate(ios_base::failbit);
- #else
- __x = complex<_Tp>(_Tp(0), _Tp(0));
- #endif
- return __is;
- }
-
- template<typename _Tp, typename _CharT, class _Traits>
- basic_ostream<_CharT, _Traits>&
- operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
- {
- basic_ostringstream<_CharT, _Traits> __s;
- __s.flags(__os.flags());
- __s.imbue(__os.getloc());
- __s.precision (__os.precision());
- __s << '(' << __x.real() << "," << __x.imag() << ')' << ends;
- return __os << __s.str();
- }
-
-
template
basic_istream<char, char_traits<char> >&
operator>>(basic_istream<char, char_traits<char> >&, complex<float>&);
--- 28,36 ----
*************** namespace std
*** 148,151 ****
--- 91,96 ----
const complex<long double>&);
#endif //_GLIBCPP_USE_WCHAR_T
} // namespace std
+
+
Index: src/locale-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale-inst.cc,v
retrieving revision 1.17
diff -c -p -r1.17 locale-inst.cc
*** locale-inst.cc 2001/03/23 20:02:03 1.17
--- locale-inst.cc 2001/05/31 12:00:33
*************** namespace std
*** 170,180 ****
// has_facet
template
bool
! has_facet<numpunct<char> >(const locale &);
#ifdef _GLIBCPP_USE_WCHAR_T
template
bool
! has_facet<numpunct<wchar_t> >(const locale &);
#endif
//
--- 170,199 ----
// has_facet
template
bool
! has_facet<numpunct<char> >(const locale&);
! template
! bool
! has_facet<num_put<char> >(const locale&);
! template
! bool
! has_facet<num_get<char> >(const locale&);
! template
! bool
! has_facet<ctype<char> >(const locale&);
!
#ifdef _GLIBCPP_USE_WCHAR_T
template
+ bool
+ has_facet<numpunct<wchar_t> >(const locale&);
+ template
+ bool
+ has_facet<num_put<wchar_t> >(const locale&);
+ template
+ bool
+ has_facet<num_get<wchar_t> >(const locale&);
+ template
bool
! has_facet<ctype<wchar_t> >(const locale&);
#endif
//
Index: testsuite/26_numerics/complex_inserters_extractors.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/26_numerics/complex_inserters_extractors.cc,v
retrieving revision 1.6
diff -c -p -r1.6 complex_inserters_extractors.cc
*** complex_inserters_extractors.cc 2001/05/12 16:51:42 1.6
--- complex_inserters_extractors.cc 2001/05/31 12:00:33
*************** testall()
*** 88,98 ****
--- 88,145 ----
return 0;
}
+ // libstdc++/2970
+ void test01()
+ {
+ using namespace std;
+ bool test = true;
+
+ complex<float> cf01(-1.1, -333.2);
+ stringstream ss;
+ ss << cf01;
+ string str = ss.str();
+ VERIFY( str == "(-1.1,-333.2)" );
+ }
+
+ // libstdc++/2985
+ struct gnu_char_traits : public std::char_traits<char>
+ { };
+
+ typedef std::basic_ostringstream<char, gnu_char_traits> gnu_sstream;
+
+ void test02()
+ {
+ bool test = true;
+
+ // Construct locale with specialized facets.
+ typedef gnu_sstream::__numput_type numput_type;
+ typedef gnu_sstream::__numget_type numget_type;
+ std::locale loc_c = std::locale::classic();
+ std::locale loc_1(loc_c, new numput_type);
+ std::locale loc_2(loc_1, new numget_type);
+ VERIFY( std::has_facet<numput_type>(loc_2) );
+ VERIFY( std::has_facet<numget_type>(loc_2) );
+
+ gnu_sstream sstr;
+ std::basic_ios<char, gnu_char_traits>* pios = &sstr;
+ sstr.imbue(loc_2);
+
+
+ std::complex<double> x(3, 4);
+ sstr << x;
+ VERIFY( sstr.str() == "(3,4)" );
+ }
+
int
main()
{
testall<float>();
testall<double>();
testall<long double>();
+
+ test01();
+ test02();
+
return 0;
}
+