diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-25 06:42:00 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-07-25 06:42:00 +0000 |
commit | d32531fd12354d99ecd41fe84eaf7c65120e79b1 (patch) | |
tree | 8717293afa4553fea5016ea02535d17ae2a0e3d3 /libstdc++-v3 | |
parent | ef7af4c322b46664ad8e66dee6d2cebc75d91fbf (diff) | |
download | gcc-d32531fd12354d99ecd41fe84eaf7c65120e79b1.tar.gz |
2002-07-24 Benjamin Kosnik <bkoz@redhat.com>
PR libstdc++/7222
* src/locale.cc (locale::locale(const char*)): Use setlocale NULL.
* testsuite/22_locale/ctor_copy_dtor.cc (test02): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/src/locale.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc | 19 |
3 files changed, 24 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ce97baad59a..f91fa787354 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2002-07-24 Benjamin Kosnik <bkoz@redhat.com> + PR libstdc++/7222 + * src/locale.cc (locale::locale(const char*)): Use setlocale NULL. + * testsuite/22_locale/ctor_copy_dtor.cc (test02): New. + +2002-07-24 Benjamin Kosnik <bkoz@redhat.com> + PR libstdc++/7230 * config/linker-map.gnu: Revert strstream patch from 2002-07-01. * include/Makefile.am (backward_headers): Use strstream, not diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 26c2834eb7d..3cb9d1b4cbf 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -202,7 +202,7 @@ namespace std if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0) (_M_impl = _S_classic)->_M_add_reference(); else if (strcmp(__s, "") == 0) - _M_impl = new _Impl(setlocale(LC_ALL, __s), 1); + _M_impl = new _Impl(setlocale(LC_ALL, NULL), 1); else _M_impl = new _Impl(__s, 1); } diff --git a/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc b/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc index 8735799c7a8..732ec1714aa 100644 --- a/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc +++ b/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc @@ -25,7 +25,6 @@ #include <stdexcept> #include <testsuite_hooks.h> - void test00() { // Should be able to do this as the first thing that happens in a @@ -238,7 +237,21 @@ void test01() } #endif // _GLIBCPP_USE___ENC_TRAITS -int main () +// libstdc++/7222 +void test02() +{ + bool test = true; + std::locale loc_c1("C"); + std::locale loc_c2 ("C"); + + std::locale loc_1(""); + std::locale loc_2(""); + + VERIFY( loc_c1 == loc_c2 ); + VERIFY( loc_1 == loc_2 ); +} + +int main() { test00(); @@ -246,5 +259,7 @@ int main () test01(); #endif + test02(); + return 0; } |