[v3] libstdc++/9269

Benjamin Kosnik bkoz@redhat.com
Wed Jan 22 20:27:00 GMT 2003


This fix, or one close to it, is already in gcc-3_2-branch and gcc-3_3-branch.

The increased strictness of the new parser had me foiled for a bit,
but Mark helped by pointing out how adding "typename" fixes the
compile.

tested x86/linux

2003-01-22  Benjamin Kosnik  <bkoz@redhat.com>
	    Sysoltsev Slawa  <Vyatcheslav.Sysoltsev@intel.com>
	    Mark Mitchell  <mark@codesourcery.com>
	
	PR libstdc++/9269
	* include/std/std_fstream.h (basic_filebuf::uflow): Declare.
	(basic_filebuf::underflow): Declare.
	Move definitions.

Index: include/std/std_fstream.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_fstream.h,v
retrieving revision 1.17
diff -c -p -r1.17 std_fstream.h
*** include/std/std_fstream.h	22 Jan 2003 16:51:51 -0000	1.17
--- include/std/std_fstream.h	22 Jan 2003 20:25:25 -0000
*************** namespace std
*** 235,245 ****
  
        // [documentation is inherited]
        virtual int_type
!       underflow() { return _M_underflow_common(false); }
  
        // [documentation is inherited]
        virtual int_type
!       uflow() { return _M_underflow_common(true); }
  
        // [documentation is inherited]
        virtual int_type
--- 235,245 ----
  
        // [documentation is inherited]
        virtual int_type
!       underflow();
  
        // [documentation is inherited]
        virtual int_type
!       uflow();
  
        // [documentation is inherited]
        virtual int_type
*************** namespace std
*** 435,441 ****
        }
      };
  
!   // Explicit specializations, defined in src/fstream.cc.
    template<> 
      basic_filebuf<char>::int_type 
      basic_filebuf<char>::_M_underflow_common(bool __bump);
--- 435,441 ----
        }
      };
  
!   // Explicit specialization declarations, defined in src/fstream.cc.
    template<> 
      basic_filebuf<char>::int_type 
      basic_filebuf<char>::_M_underflow_common(bool __bump);
*************** namespace std
*** 445,450 ****
--- 445,462 ----
      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); }
+ 
  
    // [27.8.1.5] Template class basic_ifstream
    /**



More information about the Gcc-patches mailing list