summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-17 20:07:48 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-17 20:07:48 +0000
commitf280691a88f4c88c4861638ef19e2f190c73ff74 (patch)
tree4db647a401ec37cbc6b4295f5d8708887f42d6d7 /libstdc++-v3
parentc52c607ddceb2b0360e79564ba950ed2881e56d7 (diff)
downloadgcc-f280691a88f4c88c4861638ef19e2f190c73ff74.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/std/std_fstream.h23
-rw-r--r--libstdc++-v3/src/fstream.cc20
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,5 +1,12 @@
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
* include/bits/fstream.tcc (_M_convert_to_external):
Deal correctly with noconv, as prescribed by 27.8.1.4,p8.
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<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
/**
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<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