aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@zen.org>2003-05-27 17:14:49 -0400
committerBrendan Kehoe <brendan@gcc.gnu.org>2003-05-27 17:14:49 -0400
commit87a7c5a1efaa2c339149c3ccbabdf2952824e424 (patch)
treef38f7f99b91ea02b0aa9bef10678b952e713cdb9
parent87192773c445a730b2bda81da5b0847b11cda91e (diff)
downloadgcc-87a7c5a1efaa2c339149c3ccbabdf2952824e424.zip
gcc-87a7c5a1efaa2c339149c3ccbabdf2952824e424.tar.gz
gcc-87a7c5a1efaa2c339149c3ccbabdf2952824e424.tar.bz2
locale_facets.tcc (do_get): Honor $22.2.6.3.3/8 and make sure the number of digits required after the...
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
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc12
2 files changed, 18 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index b798a16..49115a4 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index f445317..6240182 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -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;