[LLVMbugs] [Bug 13602] basic_filebuf's internal buffer is shrinking when using with some codecvt.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 17 11:37:51 PDT 2012


Howard Hinnant <hhinnant at apple.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Howard Hinnant <hhinnant at apple.com> 2012-08-17 13:37:51 CDT ---
Sorry, I can not make this change.  basic_filebuf is designed to only deal with
char external types.  I'm unconvinced that these two changes alone is enough to
relax that invariant.  The invariant exists because of several statements from
the C++ standard:


[ Note: The class template basic_filebuf treats a file as a source or sink of
bytes. In an environment that uses a large character set, the file typically
holds multibyte character sequences and the basic_filebuf
object converts those multibyte sequences into wide character sequences. — end
note ]


In order to support file I/O and multibyte/wide character conversion,
conversions are performed using members of a facet, referred to as a_codecvt in
following sections, obtained as if by
     const codecvt<charT,char,typename traits::state_type>& a_codecvt =
       use_facet<codecvt<charT,char,typename traits::state_type> >(getloc());


Effects: Behaves according to the description of
basic_streambuf<charT,traits>::underflow(), with the specialization that a
sequence of characters is read from the input sequence as if by reading from
the associated file into an internal buffer ( extern_buf) and then as if by
       char   extern_buf[XSIZE];
       char*  extern_end;

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list