Commit c82efc81 by Benjamin Kosnik Committed by Benjamin Kosnik

re PR libstdc++/7222 (g++ 3.1: locale::operator ==() doesn`t work on std::locale("") locales)


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
parent 2be2ac70
2002-07-24 Benjamin Kosnik <bkoz@redhat.com> 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 PR libstdc++/7230
* config/linker-map.gnu: Revert strstream patch from 2002-07-01. * config/linker-map.gnu: Revert strstream patch from 2002-07-01.
* include/Makefile.am (backward_headers): Use strstream, not * include/Makefile.am (backward_headers): Use strstream, not
......
...@@ -202,7 +202,7 @@ namespace std ...@@ -202,7 +202,7 @@ namespace std
if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0) if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference(); (_M_impl = _S_classic)->_M_add_reference();
else if (strcmp(__s, "") == 0) else if (strcmp(__s, "") == 0)
_M_impl = new _Impl(setlocale(LC_ALL, __s), 1); _M_impl = new _Impl(setlocale(LC_ALL, NULL), 1);
else else
_M_impl = new _Impl(__s, 1); _M_impl = new _Impl(__s, 1);
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <stdexcept> #include <stdexcept>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
void test00() void test00()
{ {
// Should be able to do this as the first thing that happens in a // Should be able to do this as the first thing that happens in a
...@@ -238,7 +237,21 @@ void test01() ...@@ -238,7 +237,21 @@ void test01()
} }
#endif // _GLIBCPP_USE___ENC_TRAITS #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(); test00();
...@@ -246,5 +259,7 @@ int main () ...@@ -246,5 +259,7 @@ int main ()
test01(); test01();
#endif #endif
test02();
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment