[PATCH] Adjust testsuite and rope for "Deprecated implicit typename"

Paolo Carlini pcarlini@unitus.it
Wed Dec 12 16:01:00 GMT 2001


Hi,

due to this recent patch from Nathan Sidwell:

    http://gcc.gnu.org/ml/gcc-patches/2001-12/msg01181.html

There are currently 3 spurious failures in the testsuite: 27_io/streambuf.cc,
ext/headers.cc and ext/rope.cc.

I have fixed them thusly (tested i686-pc-linux-gnu)

Ok to apply?

Cheers,
Paolo.

//////////////////

2001-12-12  Paolo Carlini  <pcarlini@unitus.it>

        * include/ext/ropeimpl.h (rope::_S_leaf_concat_char_iter,
        _S_destr_leaf_concat_char_iter, _S_tree_concat, _S_concat_char_iter,
        _S_destr_concat_char_iter, _S_concat, _S_substring, _S_balance)
        : Adjust implicit typename.
        * include/ext/stl_rope.h (_Rope_iterator::operator=, rope::npos):
        Adjust implicit typename.
        * testsuite/27_io/streambuf.cc: Adjust implicit typename.

diff -urN libstdc++-v3-orig/include/ext/ropeimpl.h
libstdc++-v3/include/ext/ropeimpl.h
--- libstdc++-v3-orig/include/ext/ropeimpl.h Wed Dec 12 23:13:43 2001
+++ libstdc++-v3/include/ext/ropeimpl.h Wed Dec 12 23:17:34 2001
@@ -390,7 +390,7 @@
 // Concatenate a C string onto a leaf rope by copying the rope data.
 // Used for short ropes.
 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeLeaf*
+typename rope<_CharT,_Alloc>::_RopeLeaf*
 rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
   (_RopeLeaf* __r, const _CharT* __iter, size_t __len)
 {
@@ -418,7 +418,7 @@
 #ifndef __GC
 // As above, but it's OK to clobber original if refcount is 1
 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeLeaf*
+typename rope<_CharT,_Alloc>::_RopeLeaf*
 rope<_CharT,_Alloc>::_S_destr_leaf_concat_char_iter
   (_RopeLeaf* __r, const _CharT* __iter, size_t __len)
 {
@@ -449,7 +449,7 @@
 // Does not increment (nor decrement on exception) child reference counts.
 // Result has ref count 1.
 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
 rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
 {
   _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
@@ -482,6 +482,7 @@
 }

 template <class _CharT, class _Alloc>
+typename
 rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
   (_RopeRep* __r, const _CharT*__s, size_t __slen)
 {
@@ -536,7 +537,7 @@

 #ifndef __GC
 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
 rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
   _RopeRep* __r, const _CharT* __s, size_t __slen)
 {
@@ -593,7 +594,7 @@
 #endif /* !__GC */

 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
 rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
 {
     if (0 == __left) {
@@ -648,7 +649,7 @@
 }

 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
 rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
                                size_t __start, size_t __endp1)
 {
@@ -1073,7 +1074,7 @@
 // These are Fibonacci numbers < 2**32.

 template <class _CharT, class _Alloc>
-rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
 rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
 {
     _RopeRep* __forest[_RopeRep::_S_max_rope_depth + 1];
diff -urN libstdc++-v3-orig/include/ext/stl_rope.h
libstdc++-v3/include/ext/stl_rope.h
--- libstdc++-v3-orig/include/ext/stl_rope.h Wed Dec 12 23:06:20 2001
+++ libstdc++-v3/include/ext/stl_rope.h Thu Dec 13 00:24:47 2001
@@ -1055,7 +1055,8 @@
         _RopeRep::_S_unref(_M_root);
     }
     _Rope_iterator& operator= (const _Rope_iterator& __x) {
-        _RopeRep* __old = _M_root;
+        typename
+   _Rope_iterator_base<_CharT,_Alloc>::_RopeRep* __old = _M_root;

         _RopeRep::_S_ref(__x._M_root);
         if (0 != __x._M_buf_ptr) {
@@ -2183,7 +2184,7 @@
 };

 template <class _CharT, class _Alloc>
-const rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos =
+const typename rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos =
                         (size_type)(-1);

 template <class _CharT, class _Alloc>
diff -urN libstdc++-v3-orig/testsuite/27_io/streambuf.cc
libstdc++-v3/testsuite/27_io/streambuf.cc
--- libstdc++-v3-orig/testsuite/27_io/streambuf.cc Wed Dec 12 22:51:13 2001
+++ libstdc++-v3/testsuite/27_io/streambuf.cc Thu Dec 13 00:28:37 2001
@@ -197,6 +197,8 @@
   class basic_nullbuf : public std::basic_streambuf<charT, traits>
   {
   protected:
+    typedef typename
+      std::basic_streambuf<charT, traits>::int_type int_type;
     virtual int_type
     overflow(int_type c)
     {  return traits::not_eof(c); }




More information about the Libstdc++ mailing list