]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
locale_init.cc (locale::_S_initialize_once): Move construction of classic locale...
authorBenjamin Kosnik <bkoz@redhat.com>
Wed, 7 Jan 2009 01:56:26 +0000 (01:56 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Wed, 7 Jan 2009 01:56:26 +0000 (01:56 +0000)
2009-01-06  Benjamin Kosnik  <bkoz@redhat.com>

* src/locale_init.cc (locale::_S_initialize_once): Move construction
of classic locale...
(locale::classic): Here.

From-SVN: r143149

libstdc++-v3/ChangeLog
libstdc++-v3/src/locale_init.cc

index ee30286271b0b6878628383ade980e8d7a1645c2..11bf44eef6a586a574dbf8b64835e2a29888bb54 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-06  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * src/locale_init.cc (locale::_S_initialize_once): Move construction
+       of classic locale...
+       (locale::classic): Here.
+
 2009-01-06  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * include/tr1_impl/regex: Fix bad return statements and typos.
index 28ee484112f80d1a4c2f3e47ed67657f101f755c..0730155b236ec434397988e93927cc070c0be056 100644 (file)
@@ -1,4 +1,5 @@
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 
+// 2009
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -242,9 +243,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   const locale&
   locale::classic()
-  {
+  { 
     _S_initialize();
-    return reinterpret_cast<const locale&>(c_locale);
+    return *(new (&c_locale) locale(_S_classic));
   }
 
   void
@@ -254,7 +255,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     // One reference for _S_classic, one for _S_global
     _S_classic = new (&c_locale_impl) _Impl(2);
     _S_global = _S_classic;        
-    new (&c_locale) locale(_S_classic);
   }
 
   void