[v3] Qualify calls to std::copy() in <ext/rope>

Jonathan Wakely cow@compsoc.man.ac.uk
Fri Jan 14 13:35:00 GMT 2005


There are two calls to std::copy() that aren't qualified.

This means the attached test currently fails on mainline and 3.4,
fixed by the accompanying patch. Presumably this has failed since rope
was moved out of namespace std, so is a regression against 2.95 and 3.0

2005-01-14  Jonathan Wakely  <redi@gcc.gnu.org>

	* include/ext/rope: Qualify calls to std::copy() by sequence_buffer.
	* testsuite/ext/rope/4.cc: Add.

OK for mainline and 3.4 ?

jon

-- 
sigfault
-------------- next part --------------
Index: include/ext/rope
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/rope,v
retrieving revision 1.21
diff -u -p -b -B -r1.21 rope
--- include/ext/rope	24 Nov 2004 04:11:13 -0000	1.21
+++ include/ext/rope	14 Jan 2005 13:32:36 -0000
@@ -185,7 +185,7 @@ namespace __gnu_cxx
       {
 	_M_prefix = __x._M_prefix;
 	_M_buf_count = __x._M_buf_count;
-	copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+	std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
       }
       
       sequence_buffer(sequence_buffer& __x)
@@ -212,7 +212,7 @@ namespace __gnu_cxx
       {
 	_M_prefix = __x._M_prefix;
 	_M_buf_count = __x._M_buf_count;
-	copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
+	std::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
 	return *this;
       }
       
Index: testsuite/ext/rope/4.cc
===================================================================
RCS file: testsuite/ext/rope/4.cc
diff -N testsuite/ext/rope/4.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ testsuite/ext/rope/4.cc	14 Jan 2005 13:32:36 -0000
@@ -0,0 +1,39 @@
+// 2001-10-03 From: Dimitris Vyzovitis <vyzo@media.mit.edu>
+
+// Copyright (C) 2001, 2004 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// rope (SGI extension)
+
+#include <ext/rope>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+  __gnu_cxx::crope r1("wibble");
+  __gnu_cxx::crope r2;
+  std::copy( r1.begin(), r1.end(),
+             __gnu_cxx::sequence_buffer<__gnu_cxx::crope>(r2) );
+  VERIFY( r1 == r2 );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}


More information about the Libstdc++ mailing list