First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 13598
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Benjamin Kosnik <bkoz@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Pétur Runólfsson <peturrun@gmail.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
encfilebufbug2.cc Test case text/plain 2004-01-07 11:14 317 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 13598 depends on: Show dependency tree
Show dependency graph
Bug 13598 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-03-26 15:25 Opened: 2004-01-07 11:13
Although enc_filebuf now compiles (PR 13189), it's not possible to do any
actual IO with it.

The problem seems to be that basic_filebuf assumes that state_type is
assignable, but __enc_traits isn't. Although operator= is defined for
__enc_traits, t = u doesn't result in t being equivalent to u, since
it doesn't copy the iconv_t members (_M_*_desc):

    // Need assignment operator as well.
    __enc_traits&
    operator=(const __enc_traits& __obj)
    {
      strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
      strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
      _M_in_desc = 0;
      _M_out_desc = 0;
      _M_ext_bom = __obj._M_ext_bom;
      _M_int_bom = __obj._M_int_bom;
      return *this;
    }

(Note that there is a memory leak here if _M_in_desc or _M_out_desc are
non-null.)

------- Comment #1 From Pétur Runólfsson 2004-01-07 11:14 -------
Created an attachment (id=5426) [edit]
Test case

------- Comment #2 From Benjamin Kosnik 2004-03-26 15:25 -------
Mine.

------- Comment #3 From Benjamin Kosnik 2004-05-24 21:25 -------
Fixed.

2004-03-27  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++ PR/13598
	* config/locale/ieee_1003.1-2001/codecvt_specializations.h
	(__enc_traits::_M_destroy): New.
	(__enc_traits::~__enc_traits): Use it.
	(__enc_traits::operator=): Use _M_destroy, _M_init.
	(__enc_traits::__enc_traits): Same.

2004-03-27  Petur Runolfsson  <peturr02@ru.is>

	* testsuite/ext/enc_filebuf/char/13598.cc: New.

First Last Prev Next    No search results available      Search page      Enter new bug