Patchwork [v3] libstdc++/52241

login
register
mail settings
Submitter Paolo Carlini
Date Feb. 20, 2012, 5:37 p.m.
Message ID <4F4284DC.3030009@oracle.com>
Download mbox | patch
Permalink /patch/142173/
State New
Headers show

Comments

Paolo Carlini - Feb. 20, 2012, 5:37 p.m.
Hi,

thus, this is what I'm going to commit to resolve the issue (see audit 
trail for details).

Tested x86_64-linux.

Thanks,
Paolo.

///////////////////////
2012-12-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/52241
	* src/c++98/tree.cc (local_Rb_tree_increment,
	local_Rb_tree_decrement): Add.
	(_Rb_tree_increment(const _Rb_tree_node_base*),
	_Rb_tree_decrement(const _Rb_tree_node_base*)): Use the latter.
	(_Rb_tree_increment(_Rb_tree_node_base*),
	_Rb_tree_decrement(_Rb_tree_node_base*)): New.

Patch

Index: src/c++98/tree.cc
===================================================================
--- src/c++98/tree.cc	(revision 184388)
+++ src/c++98/tree.cc	(working copy)
@@ -1,6 +1,6 @@ 
 // RB tree utilities implementation -*- C++ -*-
 
-// Copyright (C) 2003, 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2005, 2009, 2012 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -56,8 +56,8 @@ 
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
-  _Rb_tree_node_base*
-  _Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
+  static _Rb_tree_node_base*
+  local_Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
   {
     if (__x->_M_right != 0) 
       {
@@ -79,14 +79,20 @@ 
     return __x;
   }
 
+  _Rb_tree_node_base*
+  _Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
+  {
+    return local_Rb_tree_increment(__x);
+  }
+
   const _Rb_tree_node_base*
   _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ()
   {
-    return _Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x));
+    return local_Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x));
   }
 
-  _Rb_tree_node_base*
-  _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
+  static _Rb_tree_node_base*
+  local_Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
   {
     if (__x->_M_color == _S_red 
         && __x->_M_parent->_M_parent == __x)
@@ -111,10 +117,16 @@ 
     return __x;
   }
 
+  _Rb_tree_node_base*
+  _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
+  {
+    return local_Rb_tree_decrement(__x);
+  }
+
   const _Rb_tree_node_base*
   _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ()
   {
-    return _Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x));
+    return local_Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x));
   }
 
   static void