This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/9580: basic_filebuf<> with custom traits_type failsto link
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: paolo at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 13 Feb 2003 21:46:00 -0000
- Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type failsto link
- Reply-to: Paolo Carlini <pcarlini at unitus dot it>
The following reply was made to PR libstdc++/9580; it has been noted by GNATS.
From: Paolo Carlini <pcarlini@unitus.it>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: gcc-gnats@gcc.gnu.org, peturr02@ru.is, gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails
to link
Date: Thu, 13 Feb 2003 22:40:15 +0100
Gabriel Dos Reis wrote:
>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.
>
Thanks Gaby. Well, I'd like to ask a little bit more help. Perhaps we are
on the right track.
The complete error message at link time is the following:
/tmp/ccVSVF9A.o: In function `std::basic_filebuf<char,
MyTraits>::underflow()':
/tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE9underflowEv+0x15):
undefined reference to `std::basic_filebuf<char,
MyTraits>::_M_underflow_common(bool)'
/tmp/ccVSVF9A.o: In function `std::basic_filebuf<char, MyTraits>::uflow()':
/tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE5uflowEv+0x15):
undefined reference to `std::basic_filebuf<char,
MyTraits>::_M_underflow_common(bool)'
As you can see, underflow and uflow are missing the generic
_M_underflow_common.
Now, in the current std_fstream.h there is:
// Explicit specialization declarations, defined in src/fstream.cc.
template<>
basic_filebuf<char>::int_type
basic_filebuf<char>::_M_underflow_common(bool __bump);
#ifdef _GLIBCPP_USE_WCHAR_T
template<>
basic_filebuf<wchar_t>::int_type
basic_filebuf<wchar_t>::_M_underflow_common(bool __bump);
#endif
// Generic definitions.
template <typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::underflow()
{ return _M_underflow_common(false); }
template <typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::int_type
basic_filebuf<_CharT, _Traits>::uflow()
{ return _M_underflow_common(true); }
Naively, something seems suspect here: the *generic* underflow and uflow
are still there!!
Shouldn't they be disposed too, for the time being, at least?
Paolo.