locale_facets.tcc (do_get): Honor $22.2.6.3.3/8 and make sure the number of digits...
authorBrendan Kehoe <brendan@zen.org>
Tue, 27 May 2003 21:14:49 +0000 (17:14 -0400)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Tue, 27 May 2003 21:14:49 +0000 (17:14 -0400)
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().

From-SVN: r67192

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index b798a169ab48873fbbe826fb473cca4967c97989..49115a46864c4c757211a498204bf77ead27ee48 100644 (file)
@@ -1,3 +1,9 @@
+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().
+
 2003-05-27  Jonathan Wakely  <redi@gcc.gnu.org>
 
        * include/std/std_istream.h, include/std/std_ostream.h: Typo in comment.
index f44531799f015a21f17feddc8041c0d34c2b14e3..624018285d8e79347e5d18e0e4795b065db12406 100644 (file)
@@ -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;