This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/3679



tested x86/linux

2001-12-13  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++/3679
	* src/locale.cc (locale::locale(const char*)): Deal with locales
	named "".
	* testsuite/22_locale/ctor_copy_dtor.cc (test01): Modify.
	
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale.cc,v
retrieving revision 1.48
diff -c -p -r1.48 locale.cc
*** locale.cc	2001/12/12 23:16:33	1.48
--- locale.cc	2001/12/13 11:09:55
*************** namespace std 
*** 204,209 ****
--- 204,211 ----
  	_S_initialize(); 
  	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);
  	else
  	  _M_impl = new _Impl(__s, 1);
        }
Index: testsuite/22_locale/ctor_copy_dtor.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/22_locale/ctor_copy_dtor.cc,v
retrieving revision 1.11
diff -c -p -r1.11 ctor_copy_dtor.cc
*** ctor_copy_dtor.cc	2001/08/08 02:49:01	1.11
--- ctor_copy_dtor.cc	2001/12/13 11:09:56
*************** void test01()
*** 126,132 ****
    locale loc07("");
    VERIFY (loc07 != loc01);  
    VERIFY (loc07 != loc02);  
!   VERIFY (loc07.name() == "");
    try
      { locale loc08(static_cast<const char*>(NULL)); }
    catch(runtime_error& obj)
--- 126,132 ----
    locale loc07("");
    VERIFY (loc07 != loc01);  
    VERIFY (loc07 != loc02);  
!   VERIFY (loc07.name() != "");
    try
      { locale loc08(static_cast<const char*>(NULL)); }
    catch(runtime_error& obj)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]