re PR libstdc++/9580 (basic_filebuf<> with custom traits_type fails to link)
authorPaolo Carlini <pcarlini@unitus.it>
Mon, 17 Feb 2003 20:07:48 +0000 (21:07 +0100)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 17 Feb 2003 20:07:48 +0000 (20:07 +0000)
2003-02-17  Paolo Carlini  <pcarlini@unitus.it>

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
libstdc++-v3/include/std/std_fstream.h
libstdc++-v3/src/fstream.cc

index 75d729b482143b66bc00e1268f749719a77abc54..14268113aaeeb143ff55828795035bb37ba0cada 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-17  Paolo Carlini  <pcarlini@unitus.it>
+
+       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  <pcarlini@unitus.it>
 
        PR libstdc++/9169
index 6a5e3bc127b8c44cb8b234ab9108b9a7cce9122c..d7a0e0956bdf931c39ad92c8b58ed38453821aed 100644 (file)
@@ -439,23 +439,38 @@ namespace std
     basic_filebuf<char>::int_type 
     basic_filebuf<char>::_M_underflow_common(bool __bump);
 
+  template<>
+    basic_filebuf<char>::int_type
+    basic_filebuf<char>::underflow(); 
+
+  template<>
+    basic_filebuf<char>::int_type
+    basic_filebuf<char>::uflow(); 
+
  #ifdef _GLIBCPP_USE_WCHAR_T
   template<> 
     basic_filebuf<wchar_t>::int_type 
     basic_filebuf<wchar_t>::_M_underflow_common(bool __bump);
+
+  template<>
+    basic_filebuf<wchar_t>::int_type
+    basic_filebuf<wchar_t>::underflow(); 
+
+  template<>
+    basic_filebuf<wchar_t>::int_type
+    basic_filebuf<wchar_t>::uflow(); 
  #endif
 
-  // Generic definitions.
+  // Generic definitions do nothing.
   template <typename _CharT, typename _Traits>
     typename basic_filebuf<_CharT, _Traits>::int_type
     basic_filebuf<_CharT, _Traits>::underflow() 
-    { return _M_underflow_common(false); }
+    { return int_type(); }
 
   template <typename _CharT, typename _Traits>
     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
   /**
index be711339b72f7d69e27cbda99900cc90a91f13db..944bae27c381187a3f529ddc17485da1d99dc45d 100644 (file)
@@ -100,6 +100,16 @@ namespace std
       return __ret;
     }
 
+  template<>
+    basic_filebuf<char>::int_type
+    basic_filebuf<char>::underflow() 
+    { return _M_underflow_common(false); }
+
+  template<>
+    basic_filebuf<char>::int_type
+    basic_filebuf<char>::uflow() 
+    { return _M_underflow_common(true); }
+
 #ifdef _GLIBCPP_USE_WCHAR_T
   template<> 
     basic_filebuf<wchar_t>::int_type 
@@ -189,5 +199,15 @@ namespace std
       _M_last_overflowed = false;      
       return __ret;
     }
+
+  template<>
+    basic_filebuf<wchar_t>::int_type
+    basic_filebuf<wchar_t>::underflow() 
+    { return _M_underflow_common(false); }
+
+  template<>
+    basic_filebuf<wchar_t>::int_type
+    basic_filebuf<wchar_t>::uflow() 
+    { return _M_underflow_common(true); }
 #endif
 } // namespace std