Basically, money_put<>::do_put(..., long double) must use "%.0Lf" not "%.01f" (as written in the standard) nor "%.01Lf" as currently in v3: passing a long double with fractional part >= .5 constitutes a good testcase.
Subject: Bug 12971 CVSROOT: /cvs/gcc Module name: gcc Changes by: paolo@gcc.gnu.org 2003-11-09 10:47:58 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: locale_facets.tcc libstdc++-v3/docs/html/ext: howto.html Added files: libstdc++-v3/testsuite/22_locale/money_put/put/char: 12971.cc libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t: 12971.cc Log message: 2003-11-09 Paolo Carlini <pcarlini@suse.de> PR libstdc++/12971 * include/bits/locale_facets.tcc (money_put::do_put(..., long double)): Fix conversion specification as per DR 328 [WP]. * testsuite/22_locale/money_put/put/char/12971.cc: Add. * testsuite/22_locale/money_put/put/wchar_t/12971.cc: Ditto. * docs/html/ext/howto.html: Add entry for DR 328. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2071&r2=1.2072 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.142&r2=1.143 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/docs/html/ext/howto.html.diff?cvsroot=gcc&r1=1.36&r2=1.37
Fixed for 3.4.
Subject: Bug 12971 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: paolo@gcc.gnu.org 2004-01-27 01:20:19 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: locale_facets.tcc Log message: 2004-01-26 Paolo Carlini <pcarlini@suse.de> PR libstdc++/12971 * include/bits/locale_facets.tcc (money_put::do_put(..., long double)): Fix conversion specification as per DR 328 [WP]. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.169&r2=1.1464.2.170 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.82.4.15&r2=1.82.4.16