libstdc++/9580: basic_filebuf<> with custom traits_type fails to link

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Feb 13 21:28:00 GMT 2003


Paolo Carlini <pcarlini@unitus.it> writes:

| Gabriel Dos Reis wrote:
| 
| >This is something we should fix.  However I don't have necessary time
| >next week to work on it. I'm sorry.
| >
| Well, so *I* will fix it ;)
| 
| Seriously, the PR is regression from 3.0.x, "due" to this checkin of
| yours and

Aha, I'm a silly boy :-(

| Benjamin, apparently
| (the problem is with std::basic_filebuf<char,
| MyTraits>::_M_underflow_common(bool):
| 
| 2002-07-30  Benjamin Kosnik  <bkoz@redhat.com>
|             Gabriel Dos Reis  <gdr@nerim.net>
| 
| ...
| 
|     * include/std/std_fstream.h: Declare _M_underflow_common
|     specializations.
|     * src/fstream.cc: New. Add _M_underflow_common specializations.
|     * include/bits/fstream.tcc (filebuf::close): Use traits_type.
|     (filebuf::_M_underflow_common(bool)): Remove generic version, as
|     sys_ungetc and custom int_types don't get along.
| 
| ...
| 
| Can you please help me a bit understanding these Changelog entries?

If I recall correctly, this change was made because of some
differences in the way a narrow character stream based on
char_traits<char> behaves and the way the general Traits may behave.
At that point, I seem to recall that the goal was to have a general
implementation  of that function plus the special case.  I'll have to
go back and check my logs, unless Benjamin has a better recollection. 

-- Gaby



More information about the Gcc-bugs mailing list