]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/7222 (g++ 3.1: locale::operator ==() doesn`t work on std::locale...
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 25 Jul 2002 06:42:00 +0000 (06:42 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 25 Jul 2002 06:42:00 +0000 (06:42 +0000)
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.

From-SVN: r55736

libstdc++-v3/ChangeLog
libstdc++-v3/src/locale.cc
libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc

index ce97baad59a24d43a448db290de4e4cf3866c05d..f91fa787354cfe9253905449fa738e70f32eafc5 100644 (file)
@@ -1,3 +1,9 @@
+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
index 26c2834eb7d6afdf0f6bd9070ed44e25c492bd57..3cb9d1b4cbfd1f569b700add610f38263c66b364 100644 (file)
@@ -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);
       }
index 8735799c7a8340bf79f7bce39b55a2311a72c0fe..732ec1714aa23b6ae6dc638ce4f1a775b1835ffe 100644 (file)
@@ -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;
 }