[Bug libstdc++/10985] money_get should heed frac_digits

brendan@zen.org gcc-bugzilla@gcc.gnu.org
Tue May 27 04:25:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10985



------- Additional Comments From brendan@zen.org  2003-05-27 03:58 -------
(From update of attachment 4083)
2003-05-26  Brendan Kehoe  <brendan@zen.org>

	* include/bits/locale_facets.tcc (do_get): Honor $22.2.6.3.3/8 and
	make sure the number of digits required after the decimal-point
	(if any) is exactly the value returned by frac_digits().


Index: include/bits/locale_facets.tcc
===================================================================
RCS file: /cvsroot/gcc/gcc/libstdc++-v3/include/bits/locale_facets.tcc,v
retrieving revision 1.98
diff -u -p -r1.98 locale_facets.tcc
--- include/bits/locale_facets.tcc	13 May 2003 20:13:14 -0000	1.98
+++ include/bits/locale_facets.tcc	26 May 2003 20:22:18 -0000
@@ -1271,6 +1271,18 @@ namespace std
       if (__c == __eof)
	__err |= ios_base::eofbit;

+      // Iff not enough digits were supplied after the decimal-point.
+      if (__testdecfound)
+	{
+	  const int __frac = __intl ? __mpt.frac_digits() 
+				    : __mpf.frac_digits();
+	  if (__frac > 0)
+	    {
+	      if (__sep_pos != __frac)
+		__testvalid = false;
+	    }
+	}
+
       // Iff valid sequence is not recognized.
       if (!__testvalid || !__tmp_units.size())
	__err |= ios_base::failbit;




------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Gcc-bugs mailing list