public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile
@ 2003-07-16 9:15 peturr02 at ru dot is
2003-07-16 9:18 ` [Bug libstdc++/11543] " peturr02 at ru dot is
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: peturr02 at ru dot is @ 2003-07-16 9:15 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/11543] basic_filebuf with custom state_type fails to compile
2003-07-16 9:15 [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile peturr02 at ru dot is
@ 2003-07-16 9:18 ` peturr02 at ru dot is
2003-08-24 1:26 ` [Bug libstdc++/11543] [3.4 Regression] " pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: peturr02 at ru dot is @ 2003-07-16 9:18 UTC (permalink / raw)
To: gcc-bugs
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
------- Additional Comments From peturr02 at ru dot is 2003-07-16 09:18 -------
Created an attachment (id=4410)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4410&action=view)
Test case
Here is the error I get when I try to compile this:
g++0706 -Wall -static statebug.cc -o statebug
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include/c++/bits/fstream.tcc: In
member function `typename std::basic_filebuf<_CharT, _Traits>::pos_type
std::basic_filebuf<_CharT, _Traits>::seekoff(typename _Traits::off_type,
std::_Ios_Seekdir, std::_Ios_Openmode) [with _CharT = wchar_t, _Traits =
MyCharTraits]':
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include/c++/bits/fstream.tcc:102:
instantiated from `typename std::basic_filebuf<_CharT,
_Traits>::__filebuf_type* std::basic_filebuf<_CharT, _Traits>::open(const
char*, std::_Ios_Openmode) [with _CharT = wchar_t, _Traits = MyCharTraits]'
statebug.cc:75: instantiated from here
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include/c++/bits/fstream.tcc:507:
error: no
match for 'operator=' in '__ret = (this +
56)->std::__basic_file<char>::seekoff(long int, std::_Ios_Seekdir,
std::_Ios_Openmode)((__computed_off * __width), __way, __mode)'
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.4/include/c++/i686-pc-linux-gnu/bits/fpos.h:58:
note: candidates
are: std::fpos<MyState>& std::fpos<MyState>::operator=(const
std::fpos<MyState>&)
make: *** [statebug] Error 1
This program is not expected to link, since the definitions of codecvt
members are missing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/11543] [3.4 Regression] basic_filebuf with custom state_type fails to compile
2003-07-16 9:15 [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile peturr02 at ru dot is
2003-07-16 9:18 ` [Bug libstdc++/11543] " peturr02 at ru dot is
@ 2003-08-24 1:26 ` pinskia at gcc dot gnu dot org
2003-10-16 22:38 ` cvs-commit at gcc dot gnu dot org
2003-10-16 22:41 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-24 1:26 UTC (permalink / raw)
To: gcc-bugs
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
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |rejects-valid
Priority|P2 |P1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-24 01:26:05
date| |
Summary|basic_filebuf with custom |[3.4 Regression]
|state_type fails to compile |basic_filebuf with custom
| |state_type fails to compile
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-24 01:26 -------
I can confirm this on the mainline (20030823). It just be able to compile under 3.0.4
making this a regression.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/11543] [3.4 Regression] basic_filebuf with custom state_type fails to compile
2003-07-16 9:15 [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile peturr02 at ru dot is
2003-07-16 9:18 ` [Bug libstdc++/11543] " peturr02 at ru dot is
2003-08-24 1:26 ` [Bug libstdc++/11543] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-10-16 22:38 ` cvs-commit at gcc dot gnu dot org
2003-10-16 22:41 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-10-16 22:38 UTC (permalink / raw)
To: gcc-bugs
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
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-10-16 22:38 -------
Subject: Bug 11543
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bkoz@gcc.gnu.org 2003-10-16 22:37:54
Modified files:
libstdc++-v3 : ChangeLog acinclude.m4 aclocal.m4 configure
configure.ac configure.host
libstdc++-v3/config/io: basic_file_stdio.cc basic_file_stdio.h
c_io_stdio.h
libstdc++-v3/include: Makefile.am Makefile.in
libstdc++-v3/include/bits: char_traits.h fstream.tcc sstream.tcc
libstdc++-v3/include/std: std_iosfwd.h
libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char: 1-in.cc
1-io.cc
1-out.cc
2-in.cc
2-io.cc
2-out.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char: 1-in.cc
1-io.cc
1-out.cc
2-in.cc
2-io.cc
2-out.cc
libstdc++-v3/testsuite/27_io/basic_istream/seekg/char: 2.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char: 1.cc
libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char: 1.cc
libstdc++-v3/testsuite/27_io/fpos/mbstate_t: 3.cc
libstdc++-v3/testsuite/27_io/objects/char: 10.cc
Added files:
libstdc++-v3/include/bits: postypes.h
libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char:
11543.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t:
11543.cc
libstdc++-v3/testsuite/27_io/fpos: 11450.cc
libstdc++-v3/testsuite/27_io/fpos/mbstate_t: 12065.cc 4_neg.cc
libstdc++-v3/testsuite/27_io/types: 3.cc
Removed files:
libstdc++-v3/config/os/generic: fpos.h
libstdc++-v3/config/os/gnu-linux: fpos.h
Log message:
2003-10-16 Petur Runolfsson <peturr02@ru.is>
PR libstdc++/8610
PR libstdc++/11450
PR libstdc++/11543
PR libstdc++/12065
* config/io/basic_file_stdio.cc (__basic_file::seekoff):
Change return value from streampos to streamoff.
(__basic_file::seekpos): Delete.
* config/io/basic_file_stdio.h: Same.
* config/io/c_io_stdio.h: Remove streamoff and wstreamsize typedefs.
* include/Makefile.am (bits_headers): Add bits/postypes.h.
* include/bits/char_traits.h: Include bits/postypes.h instead of
bits/fpos.h.
* include/bits/fstream.tcc (basic_filebuf::open,
basic_filebuf::pbackfail): Don't use < or >= to compare pos_type
values, use == and != instead.
(basic_filebuf::_M_seek): Use explicit conversion from streamoff
to pos_type.
(basic_filebuf::imbue): Don't use ! on pos_type values, use
== instead. Don't use __check_facet(_M_codecvt) unless is_open().
* include/bits/postypes.h: New file.
Add __streamoff_base_type typedef, streamsize.
(streamoff, streampos, wstreampos): Define typedefs, with
streamoff defined as...
(streamoff): New class. Document implementation defined
aspects.
(fpos): New implementation. Document implementation defined
aspects.
* include/bits/sstream.tcc (basic_stringbuf::seekpos): Use
explicit conversion from pos_type to off_type.
* include/std/std_iosfwd.h: Include bits/postypes.h instead
of bits/fpos.h.
* testsuite/27_io/basic_filebuf/seekoff/char/11543.cc: New test.
* testsuite/27_io/basic_filebuf/seekoff/wchar_t/11543.cc: New test.
* testsuite/27_io/fpos/11450.cc: New test.
* testsuite/27_io/fpos/mbstate_t/12065.cc: New test.
* testsuite/27_io/fpos/mbstate_t/4_neg.cc: New test.
* testsuite/27_io/types/3.cc: New test.
2003-10-16 Benjamin Kosnik <bkoz@redhat.com>
* configure.host: Remove fpos_include_dir.
* configure.ac: Remove FPOS_INC_SRCDIR.
* configure: Regenerate.
* acinclude.m4 (GLIBCXX_ENABLE_CSTDIO): Remove FPOS_H.
* aclocal.m4: Regenerate.
* include/Makefile.am (host_headers): Remove fpos.h.
(bits_headers): Add postypes.h.
* include/Makefile.in: Regenerate.
* config/os/gnu-linux/fposh: Remove.
* config/os/generic/fpos.h: Remove.
* testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc: Fixup.
* testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc: Same.
* testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc: Same.
* testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc: Same.
* testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc: Same.
* testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc: Same.
* testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc: Same.
* testsuite/27_io/basic_istream/seekg/char/2.cc: Same.
* testsuite/27_io/basic_stringbuf/seekoff/char/1.cc: Same.
* testsuite/27_io/basic_stringbuf/seekpos/char/1.cc: Same.
* testsuite/27_io/fpos/mbstate_t/3.cc: Same.
* testsuite/27_io/objects/char/10.cc: Same.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2021&r2=1.2022
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/acinclude.m4.diff?cvsroot=gcc&r1=1.272&r2=1.273
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/aclocal.m4.diff?cvsroot=gcc&r1=1.286&r2=1.287
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.diff?cvsroot=gcc&r1=1.360&r2=1.361
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.ac.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/configure.host.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/io/basic_file_stdio.cc.diff?cvsroot=gcc&r1=1.21&r2=1.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/io/basic_file_stdio.h.diff?cvsroot=gcc&r1=1.14&r2=1.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/io/c_io_stdio.h.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/os/generic/fpos.h.diff?cvsroot=gcc&r1=1.2&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/config/os/gnu-linux/fpos.h.diff?cvsroot=gcc&r1=1.2&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/Makefile.am.diff?cvsroot=gcc&r1=1.70&r2=1.71
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/Makefile.in.diff?cvsroot=gcc&r1=1.88&r2=1.89
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/postypes.h.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/char_traits.h.diff?cvsroot=gcc&r1=1.22&r2=1.23
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/fstream.tcc.diff?cvsroot=gcc&r1=1.102&r2=1.103
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/sstream.tcc.diff?cvsroot=gcc&r1=1.35&r2=1.36
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_iosfwd.h.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/11543.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/11543.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/1.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/1.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/fpos/11450.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/12065.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/4_neg.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/3.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/objects/char/10.cc.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/27_io/types/3.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libstdc++/11543] [3.4 Regression] basic_filebuf with custom state_type fails to compile
2003-07-16 9:15 [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile peturr02 at ru dot is
` (2 preceding siblings ...)
2003-10-16 22:38 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-16 22:41 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-16 22:41 UTC (permalink / raw)
To: gcc-bugs
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
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-16 22:41 -------
Fixed for 3.4.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-10-16 22:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16 9:15 [Bug libstdc++/11543] New: basic_filebuf with custom state_type fails to compile peturr02 at ru dot is
2003-07-16 9:18 ` [Bug libstdc++/11543] " peturr02 at ru dot is
2003-08-24 1:26 ` [Bug libstdc++/11543] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-10-16 22:38 ` cvs-commit at gcc dot gnu dot org
2003-10-16 22:41 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).