From cded5e6bd50c24ac40fc2d86c35ee627300789f3 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 27 Nov 2007 01:59:41 +0000 Subject: locale_facets.tcc (num_put<>::_M_insert_int): When ios_base::showpos and the type is signed and the value is zero, prepend +. 2007-11-26 Paolo Carlini * include/bits/locale_facets.tcc (num_put<>::_M_insert_int): When ios_base::showpos and the type is signed and the value is zero, prepend +. * testsuite/22_locale/num_put/put/char/12.cc: New. * testsuite/22_locale/num_put/put/wchar_t/12.cc: Likewise. From-SVN: r130460 --- libstdc++-v3/include/bits/locale_facets.tcc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 12902f7..744e373 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -874,13 +874,13 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE if (__builtin_expect(__dec, true)) { // Decimal. - if (__v > 0) + if (__v >= 0) { if (bool(__flags & ios_base::showpos) && __gnu_cxx::__numeric_traits<_ValueT>::__is_signed) *--__cs = __lit[__num_base::_S_oplus], ++__len; } - else if (__v) + else *--__cs = __lit[__num_base::_S_ominus], ++__len; } else if (bool(__flags & ios_base::showbase) && __v) -- cgit v1.1