]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/13007 (basic_streambuf::pubimbue, imbue wrong)
authorPaolo Carlini <pcarlini@suse.de>
Wed, 7 Jan 2004 11:57:35 +0000 (11:57 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 7 Jan 2004 11:57:35 +0000 (11:57 +0000)
2004-01-07  Paolo Carlini  <pcarlini@suse.de>
    Petur Runolfsson  <peturr02@ru.is>

PR libstdc++/13007
* include/bits/fstream.tcc (imbue): Don't touch the stored
locale.
* include/std/std_streambuf.h (imbue): According to the
standard, base class version does nothing.
(pubimbue): Store the locale.

Co-Authored-By: Petur Runolfsson <peturr02@ru.is>
From-SVN: r75502

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/include/std/std_streambuf.h

index 34270813ca0161e741ee679897cf0998b0eba666..cac5d6285a76b1757956e4c12cba3503b321e272 100644 (file)
@@ -1,3 +1,13 @@
+2004-01-07  Paolo Carlini  <pcarlini@suse.de>
+           Petur Runolfsson  <peturr02@ru.is>
+       
+       PR libstdc++/13007
+       * include/bits/fstream.tcc (imbue): Don't touch the stored
+       locale.
+       * include/std/std_streambuf.h (imbue): According to the
+       standard, base class version does nothing.
+       (pubimbue): Store the locale.
+
 2003-12-10  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/6243
index 1efeaab470e69c4cae7acafd49f69ed39dbf438c..8727acbc440c72fcc662997a0486a4311a3fd4a2 100644 (file)
@@ -506,19 +506,8 @@ namespace std
   template<typename _CharT, typename _Traits>
     void
     basic_filebuf<_CharT, _Traits>::
-    imbue(const locale& __loc)
-    {
-      bool __testbeg = gptr() == eback() && pptr() == pbase();
-
-      if (__testbeg && _M_buf_locale != __loc)
-       _M_buf_locale = __loc;
-
-      // NB this may require the reconversion of previously
-      // converted chars. This in turn may cause the reconstruction
-      // of the original file. YIKES!!
-      // XXX The part in the above comment is not done.
-      _M_last_overflowed = false;      
-    }
+    imbue(const locale&)
+    { _M_last_overflowed = false; }
 
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.  
index a1958c1a8e7c5831a6cadb4c029b33e1ac542a9e..d058459a65fe6e214e345789d146ce286fb4f102 100644 (file)
@@ -379,6 +379,7 @@ namespace std
       {
        locale __tmp(this->getloc());
        this->imbue(__loc);
+       _M_buf_locale = __loc;
        return __tmp;
       }
 
@@ -688,15 +689,13 @@ namespace std
        *  are changed by this call.  The standard adds, "Between invocations
        *  of this function a class derived from streambuf can safely cache
        *  results of calls to locale functions and to members of facets
-       *  so obtained."  This function simply stores the new locale for use
-       *  by derived classes.
+       *  so obtained."
+       *
+       *  @note  Base class version does nothing.
       */
       virtual void 
-      imbue(const locale& __loc) 
-      { 
-       if (_M_buf_locale != __loc)
-         _M_buf_locale = __loc;
-      }
+      imbue(const locale&) 
+      { }
 
       // [27.5.2.4.2] buffer management and positioning
       /**