diff options
author | Paolo Carlini <pcarlini@suse.de> | 2007-11-27 01:59:41 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-11-27 01:59:41 +0000 |
commit | cded5e6bd50c24ac40fc2d86c35ee627300789f3 (patch) | |
tree | c09cb8fb9354473ffb8723ab94695ab22ba1e585 /libstdc++-v3/include | |
parent | aac47cd15451ddc8ef2141386478f27431cb10bb (diff) | |
download | gcc-cded5e6bd50c24ac40fc2d86c35ee627300789f3.zip gcc-cded5e6bd50c24ac40fc2d86c35ee627300789f3.tar.gz gcc-cded5e6bd50c24ac40fc2d86c35ee627300789f3.tar.bz2 |
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 <pcarlini@suse.de>
* 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
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/locale_facets.tcc | 4 |
1 files changed, 2 insertions, 2 deletions
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) |