From 1a1aed246641008d32b13e1950f8b2412ad49e74 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 17 Feb 2003 21:07:48 +0100 Subject: [PATCH] re PR libstdc++/9580 (basic_filebuf<> with custom traits_type fails to link) 2003-02-17 Paolo Carlini PR libstdc++/9580 * include/std/std_fstream.h: Declare underflow and uflow specializations, change generic definitions to do nothing. * src/fstream.cc: Add underflow and uflow specializations. From-SVN: r63008 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/std/std_fstream.h | 23 +++++++++++++++++++---- libstdc++-v3/src/fstream.cc | 20 ++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 75d729b4821..14268113aae 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2003-02-17 Paolo Carlini + + PR libstdc++/9580 + * include/std/std_fstream.h: Declare underflow and uflow + specializations, change generic definitions to do nothing. + * src/fstream.cc: Add underflow and uflow specializations. + 2003-02-17 Paolo Carlini PR libstdc++/9169 diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h index 6a5e3bc127b..d7a0e0956bd 100644 --- a/libstdc++-v3/include/std/std_fstream.h +++ b/libstdc++-v3/include/std/std_fstream.h @@ -439,23 +439,38 @@ namespace std basic_filebuf::int_type basic_filebuf::_M_underflow_common(bool __bump); + template<> + basic_filebuf::int_type + basic_filebuf::underflow(); + + template<> + basic_filebuf::int_type + basic_filebuf::uflow(); + #ifdef _GLIBCPP_USE_WCHAR_T template<> basic_filebuf::int_type basic_filebuf::_M_underflow_common(bool __bump); + + template<> + basic_filebuf::int_type + basic_filebuf::underflow(); + + template<> + basic_filebuf::int_type + basic_filebuf::uflow(); #endif - // Generic definitions. + // Generic definitions do nothing. template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::underflow() - { return _M_underflow_common(false); } + { return int_type(); } template typename basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>::uflow() - { return _M_underflow_common(true); } - + { return int_type(); } // [27.8.1.5] Template class basic_ifstream /** diff --git a/libstdc++-v3/src/fstream.cc b/libstdc++-v3/src/fstream.cc index be711339b72..944bae27c38 100644 --- a/libstdc++-v3/src/fstream.cc +++ b/libstdc++-v3/src/fstream.cc @@ -100,6 +100,16 @@ namespace std return __ret; } + template<> + basic_filebuf::int_type + basic_filebuf::underflow() + { return _M_underflow_common(false); } + + template<> + basic_filebuf::int_type + basic_filebuf::uflow() + { return _M_underflow_common(true); } + #ifdef _GLIBCPP_USE_WCHAR_T template<> basic_filebuf::int_type @@ -189,5 +199,15 @@ namespace std _M_last_overflowed = false; return __ret; } + + template<> + basic_filebuf::int_type + basic_filebuf::underflow() + { return _M_underflow_common(false); } + + template<> + basic_filebuf::int_type + basic_filebuf::uflow() + { return _M_underflow_common(true); } #endif } // namespace std