[Bug libstdc++/13860] Poor error messages on invalid template parameters for basic_filebuf
peturr02 at ru dot is
gcc-bugzilla@gcc.gnu.org
Sun Jan 25 18:56:00 GMT 2004
------- Additional Comments From peturr02 at ru dot is 2004-01-25 18:56 -------
Created an attachment (id=5578)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5578&action=view)
Test case
This test case uses long for state_type, but fpos<mbstate_t> for pos_type.
When compiled, it gives:
g++0121 -Wall -Wextra -static 3.cc -o 3
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc: In
member function `typename std::basic_filebuf<_CharT, _Traits>::pos_type
std::basic_filebuf<_CharT, _Traits>::seekpos(typename _Traits::pos_type,
std::_Ios_Openmode) [with _CharT = char, _Traits = MyTraits]':
3.cc:10: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc:637:
error: no matching function for call to `std::basic_filebuf<char,
MyTraits>::_M_seek(std::streamoff, const std::_Ios_Seekdir&, mbstate_t)'
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc:646:
note: candidates are: typename std::basic_filebuf<_CharT, _Traits>::pos_type
std::basic_filebuf<_CharT, _Traits>::_M_seek(typename _Traits::off_type,
std::_Ios_Seekdir, typename _Traits::state_type) [with _CharT = char, _Traits =
MyTraits]
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc: In
member function `typename std::basic_filebuf<_CharT, _Traits>::pos_type
std::basic_filebuf<_CharT, _Traits>::_M_seek(typename _Traits::off_type,
std::_Ios_Seekdir, typename _Traits::state_type) [with _CharT = char, _Traits =
MyTraits]':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc:618:
instantiated from `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 = char, _Traits =
MyTraits]'
3.cc:10: instantiated from here
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/fstream.tcc:657:
error: no matching function for call to `std::fpos<mbstate_t>::state(long
int&)'
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/postypes.h:178:
note: candidates are: void std::fpos<_StateT>::state(_StateT) [with _StateT =
mbstate_t]
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include/c++/bits/postypes.h:182:
note: _StateT std::fpos<_StateT>::state() const [with _StateT =
mbstate_t]
make: *** [3] Error 1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13860
More information about the Gcc-bugs
mailing list