diff options
author | Paolo Carlini <pcarlini@suse.de> | 2004-02-16 16:46:26 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2004-02-16 16:46:26 +0000 |
commit | b7e64db2a475a13f90219c36d4c9c3d846f60b1c (patch) | |
tree | 398eed3d5887c9a9a902d82333e88cb60ac16e58 | |
parent | 9ac974606795ef764ada5241981be2c899dc5586 (diff) | |
download | gcc-b7e64db2a475a13f90219c36d4c9c3d846f60b1c.zip gcc-b7e64db2a475a13f90219c36d4c9c3d846f60b1c.tar.gz gcc-b7e64db2a475a13f90219c36d4c9c3d846f60b1c.tar.bz2 |
locale_facets.tcc (money_get::do_get(string_type&)): Fix parsing of the remaining sign characters.
2004-02-16 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (money_get::do_get(string_type&)):
Fix parsing of the remaining sign characters.
* 22_locale/money_get/get/char/2.cc: Tweak: now, correctly,
the input is scanned 'til eof.
* 22_locale/money_get/get/char/4.cc: Likewise.
* 22_locale/money_get/get/wchar_t/2.cc: Likewise.
* 22_locale/money_get/get/wchar_t/4.cc: Likewise.
* 22_locale/money_get/get/char/8.cc: Tweak: override do_neg_format,
not do_pos_format: the former is the only one that matters during
input.
* 22_locale/money_get/get/wchar_t/8.cc: Likewise.
* 22_locale/money_get/get/char/6.cc: Minor tweak.
* 22_locale/money_get/get/wchar_t/6.cc: Likewise.
From-SVN: r77896
10 files changed, 36 insertions, 36 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2765ee1..3017796 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,20 @@ +2004-02-16 Paolo Carlini <pcarlini@suse.de> + + * include/bits/locale_facets.tcc (money_get::do_get(string_type&)): + Fix parsing of the remaining sign characters. + * 22_locale/money_get/get/char/2.cc: Tweak: now, correctly, + the input is scanned 'til eof. + * 22_locale/money_get/get/char/4.cc: Likewise. + * 22_locale/money_get/get/wchar_t/2.cc: Likewise. + * 22_locale/money_get/get/wchar_t/4.cc: Likewise. + * 22_locale/money_get/get/char/8.cc: Tweak: override do_neg_format, + not do_pos_format: the former is the only one that matters during + input. + * 22_locale/money_get/get/wchar_t/8.cc: Likewise. + + * 22_locale/money_get/get/char/6.cc: Minor tweak. + * 22_locale/money_get/get/wchar_t/6.cc: Likewise. + 2004-02-15 David Asher <david.asher@cavium.com> PR libstdc++/11352 diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index afbd96c..5e6128e 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -1207,7 +1207,7 @@ namespace std || ((static_cast<part>(__p.field[3]) != money_base::none) && __i == 2)) { - // According to 22.2.6.1.2.2, symbol is required + // According to 22.2.6.1.2, p2, symbol is required // if (__io.flags() & ios_base::showbase), // otherwise is optional and consumed only if // other characters are needed to complete the @@ -1293,9 +1293,8 @@ namespace std { const size_type __len = __sign.size(); size_type __i = 1; - for (; __beg != __end && __i < __len; ++__i) - for (; __beg != __end - && *__beg != __sign[__i]; ++__beg); + for (; __beg != __end && __i < __len + && *__beg == __sign[__i]; ++__beg, ++__i); if (__i != __len) __testvalid = false; diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc index 0d516a2..b9bd005 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc @@ -81,7 +81,7 @@ void test02() ios_base::iostate err10 = ios_base::goodbit; mon_get.get(is_it10, end, true, iss, err10, result10); VERIFY( result10 == digits2 ); - VERIFY( err10 == ios_base::goodbit ); + VERIFY( err10 == ios_base::eofbit ); iss.str("(HKD .01)"); iterator_type is_it11(iss); @@ -89,7 +89,7 @@ void test02() ios_base::iostate err11 = ios_base::goodbit; mon_get.get(is_it11, end, true, iss, err11, result11); VERIFY( result11 == digits4 ); - VERIFY( err11 == ios_base::goodbit ); + VERIFY( err11 == ios_base::eofbit ); // for the "en_HK" locale the parsing of the very same input streams must // be successful without showbase too, since the symbol field appears in @@ -111,7 +111,7 @@ void test02() ios_base::iostate err13 = ios_base::goodbit; mon_get.get(is_it13, end, true, iss, err13, result13); VERIFY( result13 == digits2 ); - VERIFY( err13 == ios_base::goodbit ); + VERIFY( err13 == ios_base::eofbit ); iss.str("(HKD .01)"); iterator_type is_it14(iss); @@ -119,7 +119,7 @@ void test02() ios_base::iostate err14 = ios_base::goodbit; mon_get.get(is_it14, end, true, iss, err14, result14); VERIFY( result14 == digits4 ); - VERIFY( err14 == ios_base::goodbit ); + VERIFY( err14 == ios_base::eofbit ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc index 7c009c8..c5aa7a3 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc @@ -28,8 +28,6 @@ void test04() { using namespace std; - typedef money_base::part part; - typedef money_base::pattern pattern; typedef istreambuf_iterator<char> iterator_type; bool test __attribute__((unused)) = true; @@ -64,7 +62,7 @@ void test04() ios_base::iostate err03 = ios_base::goodbit; mon_get.get(is_it03, end, true, iss, err03, result3); VERIFY( result3 == digits4 ); - VERIFY( err03 == ios_base::goodbit ); + VERIFY( err03 == ios_base::eofbit ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/6.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/6.cc index 8c03e82..434edfe 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/6.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/6.cc @@ -1,6 +1,6 @@ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -35,12 +35,6 @@ struct My_money_io : public std::moneypunct<char,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const - { - pattern pat = { { symbol, none, sign, value } }; - return pat; - } - pattern do_neg_format() const { pattern pat = { { symbol, none, sign, value } }; diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/8.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/8.cc index 01a9338..f88b521 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/8.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/8.cc @@ -34,7 +34,7 @@ struct My_money_io_a : public std::moneypunct<char,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const + pattern do_neg_format() const { pattern pat = { { sign, value, space, symbol } }; return pat; @@ -51,7 +51,7 @@ struct My_money_io_b : public std::moneypunct<char,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const + pattern do_neg_format() const { pattern pat = { { sign, value, symbol, none } }; return pat; diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc index efdec28..95a0c73 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc @@ -81,7 +81,7 @@ void test02() ios_base::iostate err10 = ios_base::goodbit; mon_get.get(is_it10, end, true, iss, err10, result10); VERIFY( result10 == digits2 ); - VERIFY( err10 == ios_base::goodbit ); + VERIFY( err10 == ios_base::eofbit ); iss.str(L"(HKD .01)"); iterator_type is_it11(iss); @@ -89,7 +89,7 @@ void test02() ios_base::iostate err11 = ios_base::goodbit; mon_get.get(is_it11, end, true, iss, err11, result11); VERIFY( result11 == digits4 ); - VERIFY( err11 == ios_base::goodbit ); + VERIFY( err11 == ios_base::eofbit ); // for the "en_HK" locale the parsing of the very same input streams must // be successful without showbase too, since the symbol field appears in @@ -111,7 +111,7 @@ void test02() ios_base::iostate err13 = ios_base::goodbit; mon_get.get(is_it13, end, true, iss, err13, result13); VERIFY( result13 == digits2 ); - VERIFY( err13 == ios_base::goodbit ); + VERIFY( err13 == ios_base::eofbit ); iss.str(L"(HKD .01)"); iterator_type is_it14(iss); @@ -119,7 +119,7 @@ void test02() ios_base::iostate err14 = ios_base::goodbit; mon_get.get(is_it14, end, true, iss, err14, result14); VERIFY( result14 == digits4 ); - VERIFY( err14 == ios_base::goodbit ); + VERIFY( err14 == ios_base::eofbit ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc index cea15f5..cb1a2ab 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc @@ -28,8 +28,6 @@ void test04() { using namespace std; - typedef money_base::part part; - typedef money_base::pattern pattern; typedef istreambuf_iterator<wchar_t> iterator_type; bool test __attribute__((unused)) = true; @@ -64,7 +62,7 @@ void test04() ios_base::iostate err03 = ios_base::goodbit; mon_get.get(is_it03, end, true, iss, err03, result3); VERIFY( result3 == digits4 ); - VERIFY( err03 == ios_base::goodbit ); + VERIFY( err03 == ios_base::eofbit ); } int main() diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/6.cc index 5d40fab..cebba6e 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/6.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/6.cc @@ -1,6 +1,6 @@ // 2001-09-12 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -35,12 +35,6 @@ struct My_money_io : public std::moneypunct<wchar_t,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const - { - pattern pat = { { symbol, none, sign, value } }; - return pat; - } - pattern do_neg_format() const { pattern pat = { { symbol, none, sign, value } }; diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/8.cc index aeaa257..2b86b36 100644 --- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/8.cc +++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/8.cc @@ -34,7 +34,7 @@ struct My_money_io_a : public std::moneypunct<wchar_t,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const + pattern do_neg_format() const { pattern pat = { { sign, value, space, symbol } }; return pat; @@ -51,7 +51,7 @@ struct My_money_io_b : public std::moneypunct<wchar_t,false> int do_frac_digits() const { return 2; } - pattern do_pos_format() const + pattern do_neg_format() const { pattern pat = { { sign, value, symbol, none } }; return pat; |