]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stl_iterator.h (make_move_iterator): Implement DR2061.
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 30 Aug 2011 15:34:50 +0000 (15:34 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 30 Aug 2011 15:34:50 +0000 (15:34 +0000)
2011-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

* include/bits/stl_iterator.h (make_move_iterator): Implement DR2061.
* testsuite/24_iterators/move_iterator/dr2061.cc: New.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
line numbers.

From-SVN: r178330

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
libstdc++-v3/testsuite/24_iterators/move_iterator/dr2061.cc [new file with mode: 0644]

index d125509d7c2d476d34e511888d3d7d33558eeebc..dac79834adcb359631afe575286d7b18b8ccffb5 100644 (file)
@@ -1,3 +1,10 @@
+2011-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/bits/stl_iterator.h (make_move_iterator): Implement DR2061.
+       * testsuite/24_iterators/move_iterator/dr2061.cc: New.
+       * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
+       line numbers.
+
 2011-08-30  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * config/os/mingw32/error_constants.h: Fix commas.
index 6c82c5c3d1f10dfd7536ca8696f93cb6a7df0373..624ae64c0ced687e1ba113583c1eac7118fdbcc0 100644 (file)
@@ -1,6 +1,7 @@
 // Iterators -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -1115,7 +1116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Iterator>
     inline move_iterator<_Iterator>
-    make_move_iterator(const _Iterator& __i)
+    make_move_iterator(_Iterator __i)
     { return move_iterator<_Iterator>(__i); }
 
   template<typename _Iterator, typename _ReturnType
index b192c656f7955d62590018f151345e1384b30c67..d007c5a9c3060a9d0d83a97ab26384265c9a73ee 100644 (file)
@@ -52,8 +52,8 @@ main()
 // { dg-warning "note" "" { target *-*-* } 479 }
 // { dg-warning "note" "" { target *-*-* } 468 }
 // { dg-warning "note" "" { target *-*-* } 829 }
-// { dg-warning "note" "" { target *-*-* } 1055 }
-// { dg-warning "note" "" { target *-*-* } 1049 }
-// { dg-warning "note" "" { target *-*-* } 341 }
-// { dg-warning "note" "" { target *-*-* } 291 }
+// { dg-warning "note" "" { target *-*-* } 1056 }
+// { dg-warning "note" "" { target *-*-* } 1050 }
+// { dg-warning "note" "" { target *-*-* } 342 }
+// { dg-warning "note" "" { target *-*-* } 292 }
 // { dg-warning "note" "" { target *-*-* } 224 }
diff --git a/libstdc++-v3/testsuite/24_iterators/move_iterator/dr2061.cc b/libstdc++-v3/testsuite/24_iterators/move_iterator/dr2061.cc
new file mode 100644 (file)
index 0000000..8bec8ef
--- /dev/null
@@ -0,0 +1,29 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2011 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 3, 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 COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <iterator>
+
+// DR 2061
+void test01()
+{
+  int a[] = { 1, 2, 3, 4 };
+  std::make_move_iterator(a + 4);
+  std::make_move_iterator(a);
+}