Commit f5ca3c34 by Paolo Carlini Committed by Paolo Carlini

iomanip (put_money): Fix thinko, use __err local, like in, eg, basic_ostream::_M_insert.

2011-12-02  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/iomanip (put_money): Fix thinko, use __err local,
	like in, eg, basic_ostream::_M_insert.

From-SVN: r181931
parent 73cb28d7
2011-12-02 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/iomanip (put_money): Fix thinko, use __err local,
like in, eg, basic_ostream::_M_insert.
2011-11-30 Benjamin Kosnik <bkoz@redhat.com> 2011-11-30 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove * acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove
......
...@@ -282,7 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -282,7 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
__catch(...) __catch(...)
{ __is._M_setstate(ios_base::badbit); } { __is._M_setstate(ios_base::badbit); }
if (ios_base::goodbit != __err) if (__err)
__is.setstate(__err); __is.setstate(__err);
} }
return __is; return __is;
...@@ -312,15 +312,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -312,15 +312,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os); typename basic_ostream<_CharT, _Traits>::sentry __cerb(__os);
if (__cerb) if (__cerb)
{ {
ios_base::iostate __err = ios_base::goodbit;
__try __try
{ {
typedef ostreambuf_iterator<_CharT, _Traits> _Iter; typedef ostreambuf_iterator<_CharT, _Traits> _Iter;
typedef money_put<_CharT, _Iter> _MoneyPut; typedef money_put<_CharT, _Iter> _MoneyPut;
const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc()); const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc());
const _Iter __end = __mp.put(_Iter(__os.rdbuf()), __f._M_intl, if (__mp.put(_Iter(__os.rdbuf()), __f._M_intl, __os,
__os, __os.fill(), __f._M_mon); __os.fill(), __f._M_mon).failed())
if (__end.failed()) __err |= ios_base::badbit;
__os.setstate(ios_base::badbit);
} }
__catch(__cxxabiv1::__forced_unwind&) __catch(__cxxabiv1::__forced_unwind&)
{ {
...@@ -329,6 +330,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -329,6 +330,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
__catch(...) __catch(...)
{ __os._M_setstate(ios_base::badbit); } { __os._M_setstate(ios_base::badbit); }
if (__err)
__os.setstate(__err);
} }
return __os; return __os;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment