Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.1.3
-
None
-
all
Description
The program below fails to compile on Solaris:
$ cat t.cpp && make t
#include <fstream>
struct Traits: std::char_traits<char>
{
typedef long off_type;
};
int main ()
{
std::basic_filebuf<char, Traits> fb;
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -pthreads -D_RWSTD_USE_CONFIG -I/build/sebor/gcc-4.0.2-15s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include -I/build/sebor/dev/stdlib/tests/include -pedantic -nostdinc++ -g -W -Wall -Wextra -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
/build/sebor/dev/stdlib/include/fstream.cc: In member function `std::basic_streambuf<_CharT, _Traits>* std::basic_filebuf<_CharT, _Traits>::setbuf(_CharT*, std::streamsize) [with _CharT = char, _Traits = Traits]':
/build/sebor/dev/stdlib/include/fstream:109: instantiated from `std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = Traits]'
t.cpp:10: instantiated from here
/build/sebor/dev/stdlib/include/fstream.cc:524: warning: comparison between signed and unsigned integer expressions
/build/sebor/dev/stdlib/include/fstream:109: instantiated from `std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = Traits]'
t.cpp:10: instantiated from here
/build/sebor/dev/stdlib/include/fstream.cc:538: warning: comparison between signed and unsigned integer expressions
/build/sebor/dev/stdlib/include/fstream.cc: In member function `int std::basic_filebuf<_CharT, _Traits>::sync() [with _CharT = char, _Traits = Traits]':
/build/sebor/dev/stdlib/include/fstream.cc:517: instantiated from `std::basic_streambuf<_CharT, _Traits>* std::basic_filebuf<_CharT, _Traits>::setbuf(_CharT*, std::streamsize) [with _CharT = char, _Traits = Traits]'
/build/sebor/dev/stdlib/include/fstream:109: instantiated from `std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = Traits]'
t.cpp:10: instantiated from here
/build/sebor/dev/stdlib/include/fstream.cc:696: warning: comparison between signed and unsigned integer expressions
/build/sebor/dev/stdlib/include/fstream.cc:517: instantiated from `std::basic_streambuf<_CharT, _Traits>* std::basic_filebuf<_CharT, _Traits>::setbuf(_CharT*, std::streamsize) [with _CharT = char, _Traits = Traits]'
/build/sebor/dev/stdlib/include/fstream:109: instantiated from `std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = Traits]'
t.cpp:10: instantiated from here
/build/sebor/dev/stdlib/include/fstream.cc:764: error: ambiguous overload for 'operator+' in '((std::basic_filebuf<char, Traits>*)this)->std::basic_filebuf<char, Traits>::_C_beg_pos + __ext_chars'
/build/sebor/dev/stdlib/include/fstream.cc:764: note: candidates are: operator+(int, long int) <built-in>
/build/sebor/dev/stdlib/include/rw/_traits.h:256: note: std::fpos<_StateT> std::fpos<_StateT>::operator+(int) const [with _StateT = __mbstate_t]
/build/sebor/dev/stdlib/include/fstream.cc: In member function `typename std::basic_filebuf<_CharT, _Traits>::int_type std::basic_filebuf<_CharT, _Traits>::underflow() [with _CharT = char, _Traits = Traits]':
t.cpp:10: instantiated from here
/build/sebor/dev/stdlib/include/fstream.cc:169: warning: comparison between signed and unsigned integer expressions
make: *** [t.o] Error 1