diff options
author | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2003-03-15 04:53:52 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2003-03-15 04:53:52 +0000 |
commit | ac1613a2c2b6be3d5f0863f8ffe3560de2f6ad00 (patch) | |
tree | 204e3dee0d4d25d00d7dec32745c0e03db31439a | |
parent | d8eed979a34b1888fe34127d183a053ccc9a6a67 (diff) | |
download | gcc-ac1613a2c2b6be3d5f0863f8ffe3560de2f6ad00.zip gcc-ac1613a2c2b6be3d5f0863f8ffe3560de2f6ad00.tar.gz gcc-ac1613a2c2b6be3d5f0863f8ffe3560de2f6ad00.tar.bz2 |
[multiple changes]
2003-03-14 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/23_containers/bitset_members.cc: Add test variable.
* testsuite/23_containers/map_insert.cc: Same.
* testsuite/22_locale/ctype/cons/char/1.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/1.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/2.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/3.cc: Same.
* testsuite/22_locale/codecvt/max_length/wchar_t/4.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc: Same.
* testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc: Same.
* testsuite/27_io/istream_exception.cc: Same.
* testsuite/27_io/filebuf_virtuals.cc: Same.
* testsuite/27_io/stringbuf_virtuals.cc: Same.
* testsuite/27_io/ostream_inserter_arith.cc: Same.
* testsuite/26_numerics/valarray_operators.cc: Same.
* testsuite/26_numerics/slice.cc: Same.
* testsuite/26_numerics/slice_array_assignment.cc: Same.
* testsuite/24_iterators/istream_iterator.cc: Same.
* mkcheck.in (TESTS_FILE): Use dejagnu-generated file if possible.
2003-03-14 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/9581
PR libstdc++/9870
* config/locale/generic/ctype_members.cc,
* config/locale/gnu/ctype_members.cc
(ctype<wchar_t>::do_widen(char)): Cast argument to
unsigned char before passing to btowc.
(ctype<wchar_t>::do_widen(const char*, const char*, wchar_t*)):
Convert characters with btowc instead of mbsrtowcs.
(ctype<wchar_t>::do_narrow(const wchar_t*, const wchar_t*,
char, char*):
Convert characters with wctob instead of wcsrtombs.
* testsuite/22_locale/ctype/narrow/wchar_t/3.cc: New test.
* testsuite/22_locale/ctype/widen/wchar_t/2.cc: New test.
* testsuite/22_locale/ctype/widen/wchar_t/3.cc: New test.
From-SVN: r64391
27 files changed, 265 insertions, 46 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6d77a24..62ce3f7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,45 @@ 2003-03-14 Benjamin Kosnik <bkoz@redhat.com> + * testsuite/23_containers/bitset_members.cc: Add test variable. + * testsuite/23_containers/map_insert.cc: Same. + * testsuite/22_locale/ctype/cons/char/1.cc: Same. + * testsuite/22_locale/codecvt/max_length/wchar_t/1.cc: Same. + * testsuite/22_locale/codecvt/max_length/wchar_t/2.cc: Same. + * testsuite/22_locale/codecvt/max_length/wchar_t/3.cc: Same. + * testsuite/22_locale/codecvt/max_length/wchar_t/4.cc: Same. + * testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc: Same. + * testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc: Same. + * testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc: Same. + * testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc: Same. + * testsuite/27_io/istream_exception.cc: Same. + * testsuite/27_io/filebuf_virtuals.cc: Same. + * testsuite/27_io/stringbuf_virtuals.cc: Same. + * testsuite/27_io/ostream_inserter_arith.cc: Same. + * testsuite/26_numerics/valarray_operators.cc: Same. + * testsuite/26_numerics/slice.cc: Same. + * testsuite/26_numerics/slice_array_assignment.cc: Same. + * testsuite/24_iterators/istream_iterator.cc: Same. + * mkcheck.in (TESTS_FILE): Use dejagnu-generated file if possible. + +2003-03-14 Petur Runolfsson <peturr02@ru.is> + + PR libstdc++/9581 + PR libstdc++/9870 + * config/locale/generic/ctype_members.cc, + * config/locale/gnu/ctype_members.cc + (ctype<wchar_t>::do_widen(char)): Cast argument to + unsigned char before passing to btowc. + (ctype<wchar_t>::do_widen(const char*, const char*, wchar_t*)): + Convert characters with btowc instead of mbsrtowcs. + (ctype<wchar_t>::do_narrow(const wchar_t*, const wchar_t*, + char, char*): + Convert characters with wctob instead of wcsrtombs. + * testsuite/22_locale/ctype/narrow/wchar_t/3.cc: New test. + * testsuite/22_locale/ctype/widen/wchar_t/2.cc: New test. + * testsuite/22_locale/ctype/widen/wchar_t/3.cc: New test. + +2003-03-14 Benjamin Kosnik <bkoz@redhat.com> + * include/stdc++.h: New. * libsupc++/exception_defines.h (__EXCEPTION_DEFINES_H): Add guard. * include/Makefile.am (stamp-std-precompile): Generate stdc++.h.gch diff --git a/libstdc++-v3/config/locale/generic/ctype_members.cc b/libstdc++-v3/config/locale/generic/ctype_members.cc index f147983..6b5a603 100644 --- a/libstdc++-v3/config/locale/generic/ctype_members.cc +++ b/libstdc++-v3/config/locale/generic/ctype_members.cc @@ -158,15 +158,18 @@ namespace std wchar_t ctype<wchar_t>:: do_widen(char __c) const - { return btowc(__c); } + { return btowc(static_cast<unsigned char>(__c)); } const char* ctype<wchar_t>:: do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const { - mbstate_t __state; - memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t)); - mbsrtowcs(__dest, &__lo, __hi - __lo, &__state); + while (__lo < __hi) + { + *__dest = btowc(static_cast<unsigned char>(*__lo)); + ++__lo; + ++__dest; + } return __hi; } @@ -183,22 +186,12 @@ namespace std do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, char* __dest) const { - size_t __offset = 0; - while (true) + while (__lo < __hi) { - const wchar_t* __start = __lo + __offset; - size_t __len = __hi - __start; - - mbstate_t __state; - memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t)); - size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state); - if (__con != __len && __start != 0) - { - __offset = __start - __lo; - __dest[__offset++] = __dfault; - } - else - break; + int __c = wctob(*__lo); + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); + ++__lo; + ++__dest; } return __hi; } diff --git a/libstdc++-v3/config/locale/gnu/ctype_members.cc b/libstdc++-v3/config/locale/gnu/ctype_members.cc index 8bc2559..34c79be 100644 --- a/libstdc++-v3/config/locale/gnu/ctype_members.cc +++ b/libstdc++-v3/config/locale/gnu/ctype_members.cc @@ -169,7 +169,7 @@ namespace std #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __c_locale __old = __uselocale(_M_c_locale_ctype); #endif - wchar_t __ret = btowc(__c); + wchar_t __ret = btowc(static_cast<unsigned char>(__c)); #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __uselocale(__old); #endif @@ -183,9 +183,12 @@ namespace std #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __c_locale __old = __uselocale(_M_c_locale_ctype); #endif - mbstate_t __state; - memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t)); - mbsrtowcs(__dest, &__lo, __hi - __lo, &__state); + while (__lo < __hi) + { + *__dest = btowc(static_cast<unsigned char>(*__lo)); + ++__lo; + ++__dest; + } #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __uselocale(__old); #endif @@ -214,22 +217,12 @@ namespace std #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __c_locale __old = __uselocale(_M_c_locale_ctype); #endif - size_t __offset = 0; - while (true) + while (__lo < __hi) { - const wchar_t* __start = __lo + __offset; - size_t __len = __hi - __start; - - mbstate_t __state; - memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t)); - size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state); - if (__con != __len && __start != 0) - { - __offset = __start - __lo; - __dest[__offset++] = __dfault; - } - else - break; + int __c = wctob(*__lo); + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); + ++__lo; + ++__dest; } #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) __uselocale(__old); diff --git a/libstdc++-v3/mkcheck.in b/libstdc++-v3/mkcheck.in index c856b05..377321c 100755 --- a/libstdc++-v3/mkcheck.in +++ b/libstdc++-v3/mkcheck.in @@ -99,6 +99,9 @@ fi # Make a list of the files we're going to run, or use an old one if it exists. if [ ! -f "$TESTS_FILE" ]; then + if [ -f "$TEST_DIR/testsuite_files" ]; then + cp $TEST_DIR/testsuite_files $TESTS_FILE + else echo "making file $TESTS_FILE" for LONG_NAME in $SRC_DIR/testsuite/*/*.cc do @@ -106,6 +109,7 @@ if [ ! -f "$TESTS_FILE" ]; then SHORT_NAME="`basename $DIR_NAME`/`basename $LONG_NAME`" echo "$SHORT_NAME" >> $TESTS_FILE done + fi fi # Nasty solution to replace GNU date(1)'s %s time_t output function. diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc index 25d66af..6b57c89 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc @@ -28,6 +28,7 @@ void test01() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc; diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc index 19e7398..07b3a2d 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc @@ -30,6 +30,7 @@ void test02() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-1"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc index 8681276..b44e86f 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc @@ -30,6 +30,7 @@ void test03() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-15"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc index 36bc3a1..15a8546 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc @@ -30,6 +30,7 @@ void test04() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.UTF-8"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc index b2995e3..5ecc99e 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc @@ -28,6 +28,7 @@ void test01() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc_c = locale::classic(); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc index 37fdf54..9c76752 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc @@ -28,6 +28,7 @@ void test02() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-1"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc index d6778d1..2d312bd 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc @@ -28,6 +28,7 @@ void test03() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.ISO-8859-15"); diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc index fd85941..cd4d08d 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc @@ -28,6 +28,7 @@ void test04() { using namespace std; + bool test = true; typedef codecvt<wchar_t, char, mbstate_t> w_codecvt; locale loc ("en_US.UTF-8"); diff --git a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc index 5ad3877..4846aec 100644 --- a/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc +++ b/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc @@ -51,7 +51,8 @@ public: void test01() { using namespace std; - + bool test = true; + comma_ctype obj; const ctype_base::mask* tmp = obj.get_classic_table(); diff --git a/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc new file mode 100644 index 0000000..f235d8a --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc @@ -0,0 +1,56 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// 22.2.1.3.2 ctype<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9581 +void test03() +{ + using namespace std; + bool test = true; + + locale loc ("se_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const wchar_t* wstrlit = L"\x80"; + + char buf[2]; + wct.narrow(wstrlit, wstrlit + 2, ' ', buf); + VERIFY( buf[0] == wct.narrow(wstrlit[0], ' ') ); + VERIFY( buf[1] == wct.narrow(wstrlit[1], ' ') ); +} + +int main() +{ + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc new file mode 100644 index 0000000..e4e4967 --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc @@ -0,0 +1,54 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// 22.2.1.3.2 ctype<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9870 +void test02() +{ + using namespace std; + bool test = true; + + locale loc ("en_US.ISO-8859-1"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + char c = 0xff; + wchar_t wc = wct.widen(c); + + VERIFY( wc == static_cast<wchar_t>(0xff) ); +} + +int main() +{ + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc new file mode 100644 index 0000000..e872a94 --- /dev/null +++ b/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc @@ -0,0 +1,57 @@ +// 2003-03-12 Petur Runolfsson <peturr02@ru.is> + +// Copyright (C) 2003 Free Software Foundation, Inc. +// +// 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// 22.2.1.3.2 ctype<wchar_t> members + +#include <locale> +#include <testsuite_hooks.h> + +// libstdc++/9581 +void test03() +{ + using namespace std; + bool test = true; + + locale loc ("se_NO.UTF-8"); + const ctype<wchar_t>& wct = use_facet<ctype<wchar_t> >(loc); + + const char* strlit = "\xc2\x80"; + + wchar_t wbuf[3]; + wct.widen(strlit, strlit + 3, wbuf); + VERIFY( wbuf[0] == wct.widen(strlit[0]) ); + VERIFY( wbuf[1] == wct.widen(strlit[1]) ); + VERIFY( wbuf[2] == wct.widen(strlit[2]) ); +} + +int main() +{ + test03(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/bitset_members.cc b/libstdc++-v3/testsuite/23_containers/bitset_members.cc index 054018d..82e3a48 100644 --- a/libstdc++-v3/testsuite/23_containers/bitset_members.cc +++ b/libstdc++-v3/testsuite/23_containers/bitset_members.cc @@ -1,6 +1,6 @@ // 2001-06-03 pme -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // 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 @@ -55,6 +55,7 @@ void test02() void test03() { + bool test = true; std::bitset<5> b; std::stringstream ss ("101"); diff --git a/libstdc++-v3/testsuite/23_containers/map_insert.cc b/libstdc++-v3/testsuite/23_containers/map_insert.cc index d870897..67c838f 100644 --- a/libstdc++-v3/testsuite/23_containers/map_insert.cc +++ b/libstdc++-v3/testsuite/23_containers/map_insert.cc @@ -1,6 +1,6 @@ // 2001-08-23 pme & Sylvain.Pion@sophia.inria.fr -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // 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 @@ -29,6 +29,7 @@ // http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01375.html void test01() { + bool test = true; typedef std::map<int, int> Map; Map M; Map::iterator hint; diff --git a/libstdc++-v3/testsuite/23_containers/vector_bool.cc b/libstdc++-v3/testsuite/23_containers/vector_bool.cc index 17d63d1..1783649 100644 --- a/libstdc++-v3/testsuite/23_containers/vector_bool.cc +++ b/libstdc++-v3/testsuite/23_containers/vector_bool.cc @@ -1,6 +1,6 @@ // 2002-03-05 Stephen M. Webb <stephen.webb@bregmasoft.com> -// Copyright (C) 2002 Free Software Foundation, Inc. +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. // // 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 @@ -32,6 +32,7 @@ void test01() // libstdc++/6886 void test02() { + bool test = true; typedef std::vector<bool> bvec; int i, num = 0; bvec v; diff --git a/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc index ce41ee6..d278e19 100644 --- a/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc +++ b/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc @@ -1,6 +1,6 @@ // 2001-06-25 Benjamin Kosnik <bkoz@redhat.com> -// Copyright (C) 2001 Free Software Foundation, Inc. +// Copyright (C) 2001, 2003 Free Software Foundation, Inc. // // 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 @@ -53,6 +53,7 @@ template class std::istream_iterator<char>; void test02() { using namespace std; + bool test = true; string st("R.Rorty"); diff --git a/libstdc++-v3/testsuite/26_numerics/slice.cc b/libstdc++-v3/testsuite/26_numerics/slice.cc index 42b2adb..a02c1f5 100644 --- a/libstdc++-v3/testsuite/26_numerics/slice.cc +++ b/libstdc++-v3/testsuite/26_numerics/slice.cc @@ -1,6 +1,6 @@ // 20020717 gdr -// Copyright (C) 2002 Free Software Foundation, Inc. +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. // // 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 @@ -51,6 +51,7 @@ assignment(int start, int size, int stride) int main() { + bool test = true; std::srand(20020717); using std::rand; VERIFY(construction(rand(), rand(), rand())); diff --git a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc index 52dcfe0..a637b87 100644 --- a/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc +++ b/libstdc++-v3/testsuite/26_numerics/slice_array_assignment.cc @@ -1,6 +1,6 @@ // 20010613 gdr -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. // // 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 @@ -34,6 +34,7 @@ int main() { + bool test = true; using std::valarray; using std::slice; valarray<int> v(1, 10), w(2, 10); diff --git a/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc b/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc index 5753e47..84c072a 100644 --- a/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc +++ b/libstdc++-v3/testsuite/26_numerics/valarray_operators.cc @@ -24,6 +24,7 @@ void test01() // check unary operators { + bool test = true; std::valarray<int> u(1); u[0]=1; @@ -35,6 +36,7 @@ void test01() // check unary operators void test02() // check binary operators { + bool test = true; std::valarray<int> u(1), v(1); u[0]=1; v[0]=3; diff --git a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc index 2bccbd9..a881086 100644 --- a/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/filebuf_virtuals.cc @@ -546,6 +546,7 @@ class MyTraits : public std::char_traits<char> public: static bool eq(char c1, char c2) { + bool test = true; VERIFY( c1 != 'X' ); VERIFY( c2 != 'X' ); return std::char_traits<char>::eq(c1, c2); diff --git a/libstdc++-v3/testsuite/27_io/istream_exception.cc b/libstdc++-v3/testsuite/27_io/istream_exception.cc index 2c3b121..055c4fb 100644 --- a/libstdc++-v3/testsuite/27_io/istream_exception.cc +++ b/libstdc++-v3/testsuite/27_io/istream_exception.cc @@ -40,6 +40,7 @@ struct buf: std::streambuf void test01() { using namespace std; + bool test = true; buf b; std::istream strm (&b); diff --git a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc index 6f9719f..2523ab6 100644 --- a/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc +++ b/libstdc++-v3/testsuite/27_io/ostream_inserter_arith.cc @@ -1,7 +1,7 @@ // 1999-11-15 Kevin Ediger <kediger@licor.com> // test the floating point inserters (facet num_put) -// Copyright (C) 1999, 2002 Free Software Foundation, Inc. +// Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. // // 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 @@ -360,6 +360,7 @@ test04() int test05() { + bool test = true; double pi = 3.14159265358979323846; ostringstream ostr; ostr.precision(20); @@ -377,6 +378,7 @@ test05() int test06() { + bool test = true; int prec = numeric_limits<double>::digits10 + 2; double oval = numeric_limits<double>::min(); diff --git a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc index c172f32..40e95ba 100644 --- a/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc +++ b/libstdc++-v3/testsuite/27_io/stringbuf_virtuals.cc @@ -40,6 +40,7 @@ void test01() void test02(std::stringbuf& in, bool pass) { + bool test = true; using namespace std; typedef streambuf::pos_type pos_type; typedef streambuf::off_type off_type; |