This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2003 09:15:43 -0000
- Subject: [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11543
Summary: basic_filebuf with custom state_type fails to compile
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
basic_filebuf::seekoff assumes that it is possible to convert from streampos
to pos_type. Since pos_type must be fpos<state_type>, this fails when
state_type is not mbstate_t.
The failure appears at the line:
__ret = _M_file.seekoff(__computed_off * __width, __way, __mode);
It seems that __basic_file::seekoff returns streampos. However, the state
part of the streampos is not used (as __basic_file knows nothing about
codecvt, state_type or even the character type), so it might just as well
return streamoff.