Commit ca0f8fd1 by Paolo Carlini

[multiple changes]

2008-06-21  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_move.h: Rename to move.h.
	* include/std/utility: Adjust.
	* include/ext/vstring_util.h: Likewise.
	* include/ext/throw_allocator.h: Likewise.
	* include/ext/pool_allocator.h: Likewise.
	* include/ext/bitmap_allocator.h: Likewise.
	* include/ext/new_allocator.h: Likewise.
	* include/ext/malloc_allocator.h: Likewise.
	* include/ext/array_allocator.h: Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/bits/stl_algobase.h: Likewise.
	* include/bits/stl_heap.h: Likewise.
	* include/bits/stl_pair.h: Likewise.
	* include/bits/stl_iterator.h: Likewise.
	* testsuite/util/testsuite_allocator.h: Likewise.
	* testsuite/util/testsuite_iterators.h: Likewise.
	* include/Makefile.am: Likewise.
	* include/Makefile.in: Regenerate.

2008-06-21  Chris Fairles  <chris.fairles@gmail.com>

	* include/bits/unique_ptr.h: New.
	* include/std/memory: Adjust.
	* include/Makefile.am: Add.
	* testsuite/20_util/unique_ptr/requirements/explicit_instantiation/
	explicit_instantiation.cc: New.
	* testsuite/20_util/unique_ptr/assign/assign.cc: Likewise.
	* include/Makefile.in: Regenerate.

From-SVN: r137003
parent c764e1bd
2008-06-21 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_move.h: Rename to move.h.
* include/std/utility: Adjust.
* include/ext/vstring_util.h: Likewise.
* include/ext/throw_allocator.h: Likewise.
* include/ext/pool_allocator.h: Likewise.
* include/ext/bitmap_allocator.h: Likewise.
* include/ext/new_allocator.h: Likewise.
* include/ext/malloc_allocator.h: Likewise.
* include/ext/array_allocator.h: Likewise.
* include/ext/mt_allocator.h: Likewise.
* include/bits/stl_algobase.h: Likewise.
* include/bits/stl_heap.h: Likewise.
* include/bits/stl_pair.h: Likewise.
* include/bits/stl_iterator.h: Likewise.
* testsuite/util/testsuite_allocator.h: Likewise.
* testsuite/util/testsuite_iterators.h: Likewise.
* include/Makefile.am: Likewise.
* include/Makefile.in: Regenerate.
2008-06-21 Chris Fairles <chris.fairles@gmail.com>
* include/bits/unique_ptr.h: New.
* include/std/memory: Adjust.
* include/Makefile.am: Add.
* testsuite/20_util/unique_ptr/requirements/explicit_instantiation/
explicit_instantiation.cc: New.
* testsuite/20_util/unique_ptr/assign/assign.cc: Likewise.
* include/Makefile.in: Regenerate.
2008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com> 2008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/c_global/climits, include/tr1/climits: Add parentheses. * include/c_global/climits, include/tr1/climits: Add parentheses.
......
...@@ -104,6 +104,7 @@ bits_headers = \ ...@@ -104,6 +104,7 @@ bits_headers = \
${bits_srcdir}/locale_facets_nonio.tcc \ ${bits_srcdir}/locale_facets_nonio.tcc \
${bits_srcdir}/localefwd.h \ ${bits_srcdir}/localefwd.h \
${bits_srcdir}/mask_array.h \ ${bits_srcdir}/mask_array.h \
${bits_srcdir}/move.h \
${bits_srcdir}/ostream.tcc \ ${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \ ${bits_srcdir}/ostream_insert.h \
${bits_srcdir}/postypes.h \ ${bits_srcdir}/postypes.h \
...@@ -123,7 +124,6 @@ bits_headers = \ ...@@ -123,7 +124,6 @@ bits_headers = \
${bits_srcdir}/stl_iterator_base_types.h \ ${bits_srcdir}/stl_iterator_base_types.h \
${bits_srcdir}/stl_list.h \ ${bits_srcdir}/stl_list.h \
${bits_srcdir}/stl_map.h \ ${bits_srcdir}/stl_map.h \
${bits_srcdir}/stl_move.h \
${bits_srcdir}/stl_multimap.h \ ${bits_srcdir}/stl_multimap.h \
${bits_srcdir}/stl_multiset.h \ ${bits_srcdir}/stl_multiset.h \
${bits_srcdir}/stl_numeric.h \ ${bits_srcdir}/stl_numeric.h \
...@@ -139,6 +139,7 @@ bits_headers = \ ...@@ -139,6 +139,7 @@ bits_headers = \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/unique_ptr.h \
${bits_srcdir}/valarray_array.h \ ${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \ ${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_before.h \ ${bits_srcdir}/valarray_before.h \
......
...@@ -357,6 +357,7 @@ bits_headers = \ ...@@ -357,6 +357,7 @@ bits_headers = \
${bits_srcdir}/locale_facets_nonio.tcc \ ${bits_srcdir}/locale_facets_nonio.tcc \
${bits_srcdir}/localefwd.h \ ${bits_srcdir}/localefwd.h \
${bits_srcdir}/mask_array.h \ ${bits_srcdir}/mask_array.h \
${bits_srcdir}/move.h \
${bits_srcdir}/ostream.tcc \ ${bits_srcdir}/ostream.tcc \
${bits_srcdir}/ostream_insert.h \ ${bits_srcdir}/ostream_insert.h \
${bits_srcdir}/postypes.h \ ${bits_srcdir}/postypes.h \
...@@ -376,7 +377,6 @@ bits_headers = \ ...@@ -376,7 +377,6 @@ bits_headers = \
${bits_srcdir}/stl_iterator_base_types.h \ ${bits_srcdir}/stl_iterator_base_types.h \
${bits_srcdir}/stl_list.h \ ${bits_srcdir}/stl_list.h \
${bits_srcdir}/stl_map.h \ ${bits_srcdir}/stl_map.h \
${bits_srcdir}/stl_move.h \
${bits_srcdir}/stl_multimap.h \ ${bits_srcdir}/stl_multimap.h \
${bits_srcdir}/stl_multiset.h \ ${bits_srcdir}/stl_multiset.h \
${bits_srcdir}/stl_numeric.h \ ${bits_srcdir}/stl_numeric.h \
...@@ -392,6 +392,7 @@ bits_headers = \ ...@@ -392,6 +392,7 @@ bits_headers = \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/unique_ptr.h \
${bits_srcdir}/valarray_array.h \ ${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \ ${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_before.h \ ${bits_srcdir}/valarray_before.h \
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
#include <bits/stl_iterator.h> #include <bits/stl_iterator.h>
#include <bits/concept_check.h> #include <bits/concept_check.h>
#include <debug/debug.h> #include <debug/debug.h>
#include <bits/stl_move.h> // For std::swap and _GLIBCXX_MOVE #include <bits/move.h> // For std::swap and _GLIBCXX_MOVE
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#define _STL_HEAP_H 1 #define _STL_HEAP_H 1
#include <debug/debug.h> #include <debug/debug.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#include <bits/cpp_type_traits.h> #include <bits/cpp_type_traits.h>
#include <ext/type_traits.h> #include <ext/type_traits.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// Pair implementation -*- C++ -*- // Pair implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
#ifndef _STL_PAIR_H #ifndef _STL_PAIR_H
#define _STL_PAIR_H 1 #define _STL_PAIR_H 1
#include <bits/stl_move.h> // for std::move / std::forward, std::decay, and #include <bits/move.h> // for std::move / std::forward, std::decay, and
// std::swap // std::swap
_GLIBCXX_BEGIN_NAMESPACE(std) _GLIBCXX_BEGIN_NAMESPACE(std)
......
// array allocator -*- C++ -*- // array allocator -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <new> #include <new>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <tr1/array> #include <tr1/array>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
// Bitmap Allocator. -*- C++ -*- // Bitmap Allocator. -*- C++ -*-
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <new> // For operator new. #include <new> // For operator new.
#include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT #include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT
#include <ext/concurrence.h> #include <ext/concurrence.h>
#include <bits/stl_move.h> #include <bits/move.h>
/** @brief The constant in the expression below is the alignment /** @brief The constant in the expression below is the alignment
* required in bytes. * required in bytes.
......
// Allocator that wraps "C" malloc -*- C++ -*- // Allocator that wraps "C" malloc -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <cstdlib> #include <cstdlib>
#include <new> #include <new>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
// MT-optimized allocator -*- C++ -*- // MT-optimized allocator -*- C++ -*-
// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
#include <cstdlib> #include <cstdlib>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <ext/atomicity.h> #include <ext/atomicity.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <new> #include <new>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <ext/atomicity.h> #include <ext/atomicity.h>
#include <ext/concurrence.h> #include <ext/concurrence.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
// -*- C++ -*- // -*- C++ -*-
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the terms
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#include <utility> #include <utility>
#include <tr1/random> #include <tr1/random>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
// Versatile string utility -*- C++ -*- // Versatile string utility -*- C++ -*-
// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include <bits/ostream_insert.h> #include <bits/ostream_insert.h>
#include <bits/stl_iterator.h> #include <bits/stl_iterator.h>
#include <ext/numeric_traits.h> #include <ext/numeric_traits.h>
#include <bits/stl_move.h> #include <bits/move.h>
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
......
// <memory> -*- C++ -*- // <memory> -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
# include <ext/concurrence.h> # include <ext/concurrence.h>
# include <bits/functexcept.h> # include <bits/functexcept.h>
# include <bits/stl_function.h> // std::less # include <bits/stl_function.h> // std::less
# include <bits/unique_ptr.h>
# include <debug/debug.h> # include <debug/debug.h>
# include <type_traits> # include <type_traits>
# if _GLIBCXX_DEPRECATED # if _GLIBCXX_DEPRECATED
......
// <utility> -*- C++ -*- // <utility> -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
# undef _GLIBCXX_BEGIN_NAMESPACE_TR1 # undef _GLIBCXX_BEGIN_NAMESPACE_TR1
# undef _GLIBCXX_INCLUDE_AS_CXX0X # undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif # endif
# include <bits/stl_move.h> # include <bits/move.h>
#endif #endif
#endif /* _GLIBCXX_UTILITY */ #endif /* _GLIBCXX_UTILITY */
// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2008 Free Software Foundation
//
// 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, 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
#include <memory>
struct base { virtual ~base() {} };
struct derived : base {};
void
test01()
{
std::unique_ptr<derived> p1(new derived);
std::unique_ptr<derived> p2(new derived);
// p2 = p1; // should not compile
p2 = std::move(p1);
std::unique_ptr<base> p3(new base);
// p3 = p2; // should not compile
p3 = std::move(p2);
}
void
test02()
{
std::unique_ptr<int[]> p1(new int(420));
std::unique_ptr<int[]> p2 = p1; // { dg-error "within this context" }
}
void
test03()
{
std::unique_ptr<int[2]> p1(new int[3]);
std::unique_ptr<int[2]> p2 = p1; // { dg-error "within this context" }
}
// { dg-excess-errors "is private" }
// { dg-options "-std=gnu++0x" }
// { dg-do compile }
// Copyright (C) 2008 Free Software Foundation
//
// 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, 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.
#include <memory>
template class std::unique_ptr<int>;
template class std::unique_ptr<int[]>;
// -*- C++ -*- // -*- C++ -*-
// Testing allocator for the C++ library testsuite. // Testing allocator for the C++ library testsuite.
// //
// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 // Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include <cstddef> #include <cstddef>
#include <tr1/unordered_map> #include <tr1/unordered_map>
#include <cassert> #include <cassert>
#include <bits/stl_move.h> #include <bits/move.h>
namespace namespace
{ {
......
// -*- C++ -*- // -*- C++ -*-
// Iterator Wrappers for the C++ library testsuite. // Iterator Wrappers for the C++ library testsuite.
// //
// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
#include <bits/stl_iterator_base_types.h> #include <bits/stl_iterator_base_types.h>
#include <bits/stl_move.h> #include <bits/move.h>
#ifndef _TESTSUITE_ITERATORS #ifndef _TESTSUITE_ITERATORS
#define _TESTSUITE_ITERATORS #define _TESTSUITE_ITERATORS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment