From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32700 invoked by alias); 13 Feb 2003 21:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 32686 invoked by uid 71); 13 Feb 2003 21:46:01 -0000 Date: Thu, 13 Feb 2003 21:46:00 -0000 Message-ID: <20030213214600.32685.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Paolo Carlini Subject: Re: libstdc++/9580: basic_filebuf<> with custom traits_type fails to link Reply-To: Paolo Carlini X-SW-Source: 2003-02/txt/msg00597.txt.bz2 List-Id: The following reply was made to PR libstdc++/9580; it has been noted by GNATS. From: Paolo Carlini To: Gabriel Dos Reis 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 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::underflow()': /tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE9underflowEv+0x15): undefined reference to `std::basic_filebuf::_M_underflow_common(bool)' /tmp/ccVSVF9A.o: In function `std::basic_filebuf::uflow()': /tmp/ccVSVF9A.o(.gnu.linkonce.t._ZNSt13basic_filebufIc8MyTraitsE5uflowEv+0x15): undefined reference to `std::basic_filebuf::_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::int_type basic_filebuf::_M_underflow_common(bool __bump); #ifdef _GLIBCPP_USE_WCHAR_T template<> basic_filebuf::int_type basic_filebuf::_M_underflow_common(bool __bump); #endif // Generic definitions. template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::underflow() { return _M_underflow_common(false); } template 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.