* include/bits/stl_algo.h (reverse_copy): Update comment per DR 2074.
* include/bits/unordered_map.h: Apply DR 2005 resolution.
* doc/xml/manual/status_cxx2011.xml: Update per DR 2048.
* include/bits/allocator.h (allocator): Apply DR 2103 resolution.
* include/ext/array_allocator.h: Likewise.
* include/ext/bitmap_allocator.h: Likewise.
* include/ext/malloc_allocator.h: Likewise.
* include/ext/mt_allocator.h: Likewise.
* include/ext/new_allocator.h: Likewise.
* include/ext/pool_allocator.h: Likewise.
* include/ext/throw_allocator.h: Likewise.
* include/ext/alloc_traits.h (__allocator_always_compares_equal): Add
additional specializations.
* include/std/functional: Add comment about DR resolution.
* include/std/future: Likewise.
* include/std/scoped_allocator: Likewise.
* include/std/thread: Likewise.
* testsuite/20_util/allocator/requirements/typedefs.cc: New.
* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error line numbers.
From-SVN: r193638
+2012-11-19 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * include/bits/stl_algo.h (reverse_copy): Update comment per DR 2074.
+ * include/bits/unordered_map.h: Apply DR 2005 resolution.
+ * doc/xml/manual/status_cxx2011.xml: Update per DR 2048.
+ * include/bits/allocator.h (allocator): Apply DR 2103 resolution.
+ * include/ext/array_allocator.h: Likewise.
+ * include/ext/bitmap_allocator.h: Likewise.
+ * include/ext/malloc_allocator.h: Likewise.
+ * include/ext/mt_allocator.h: Likewise.
+ * include/ext/new_allocator.h: Likewise.
+ * include/ext/pool_allocator.h: Likewise.
+ * include/ext/throw_allocator.h: Likewise.
+ * include/ext/alloc_traits.h (__allocator_always_compares_equal): Add
+ additional specializations.
+ * include/std/functional: Add comment about DR resolution.
+ * include/std/future: Likewise.
+ * include/std/scoped_allocator: Likewise.
+ * include/std/thread: Likewise.
+ * testsuite/20_util/allocator/requirements/typedefs.cc: New.
+ * testsuite/20_util/bind/ref_neg.cc: Adjust dg-error line numbers.
+
2012-11-19 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/hashtable.h: Improve comments.
<entry/>
</row>
<row>
- <?dbhtml bgcolor="#B0B0B0" ?>
<entry>20.8.10</entry>
<entry>Function template <code>mem_fn</code></entry>
- <entry>Partial</entry>
- <entry>Missing overloads for reference-qualified member functions</entry>
+ <entry>Y</entry>
+ <entry/>
</row>
<row>
<entry>20.8.11</entry>
// Allocators -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-// 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2001-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
// Define the base class to std::allocator.
#include <bits/c++allocator.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
namespace std _GLIBCXX_VISIBILITY(default)
{
template<typename _Tp1>
struct rebind
{ typedef allocator<_Tp1> other; };
+
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. std::allocator propagate_on_container_move_assignment
+ typedef true_type propagate_on_container_move_assignment;
+#endif
};
/**
struct rebind
{ typedef allocator<_Tp1> other; };
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. std::allocator propagate_on_container_move_assignment
+ typedef true_type propagate_on_container_move_assignment;
+#endif
+
allocator() throw() { }
allocator(const allocator& __a) throw()
* range @p [__result,__result+(__last-__first)) such that the
* order of the elements is reversed. For every @c i such that @p
* 0<=i<=(__last-__first), @p reverse_copy() performs the
- * assignment @p *(__result+(__last-__first)-i) = *(__first+i).
+ * assignment @p *(__result+(__last-__first)-1-i) = *(__first+i).
* The ranges @p [__first,__last) and @p
* [__result,__result+(__last-__first)) must not overlap.
*/
insert(const value_type& __x)
{ return _M_h.insert(__x); }
- template<typename _Pair>
+ template<typename _Pair, typename = typename
+ std::enable_if<std::is_constructible<value_type,
+ _Pair&&>::value>::type>
std::pair<iterator, bool>
insert(_Pair&& __x)
{ return _M_h.insert(std::move(__x)); }
insert(const_iterator __hint, const value_type& __x)
{ return _M_h.insert(__hint, __x); }
- template<typename _Pair>
+ template<typename _Pair, typename = typename
+ std::enable_if<std::is_constructible<value_type,
+ _Pair&&>::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __x)
{ return _M_h.insert(__hint, std::move(__x)); }
insert(const value_type& __x)
{ return _M_h.insert(__x); }
- template<typename _Pair>
+ template<typename _Pair, typename = typename
+ std::enable_if<std::is_constructible<value_type,
+ _Pair&&>::value>::type>
iterator
insert(_Pair&& __x)
{ return _M_h.insert(std::move(__x)); }
insert(const_iterator __hint, const value_type& __x)
{ return _M_h.insert(__hint, __x); }
- template<typename _Pair>
+ template<typename _Pair, typename = typename
+ std::enable_if<std::is_constructible<value_type,
+ _Pair&&>::value>::type>
iterator
insert(const_iterator __hint, _Pair&& __x)
{ return _M_h.insert(__hint, std::move(__x)); }
const bool
__allocator_always_compares_equal<array_allocator<_Tp, _Array>>::value;
+ template<typename> struct bitmap_allocator;
+
+ template<typename _Tp>
+ struct __allocator_always_compares_equal<bitmap_allocator<_Tp>>
+ { static const bool value = true; };
+
+ template<typename _Tp>
+ const bool __allocator_always_compares_equal<bitmap_allocator<_Tp>>::value;
+
+ template<typename> struct malloc_allocator;
+
+ template<typename _Tp>
+ struct __allocator_always_compares_equal<malloc_allocator<_Tp>>
+ { static const bool value = true; };
+
+ template<typename _Tp>
+ const bool __allocator_always_compares_equal<malloc_allocator<_Tp>>::value;
+
template<typename> struct mt_allocator;
template<typename _Tp>
// array allocator -*- C++ -*-
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2004-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
#include <bits/functexcept.h>
#include <tr1/array>
#include <bits/move.h>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <type_traits>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
typedef _Tp value_type;
typedef _Array array_type;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. std::allocator propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
private:
array_type* _M_array;
size_type _M_used;
// Bitmap Allocator. -*- C++ -*-
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2004-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
typedef bitmap_allocator<_Tp1> other;
};
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
private:
template<size_t _BSize, size_t _AlignSize>
struct aligned_size
// Allocator that wraps "C" malloc -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-// 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-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
#include <new>
#include <bits/functexcept.h>
#include <bits/move.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
struct rebind
{ typedef malloc_allocator<_Tp1> other; };
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
malloc_allocator() _GLIBCXX_USE_NOEXCEPT { }
malloc_allocator(const malloc_allocator&) _GLIBCXX_USE_NOEXCEPT { }
// MT-optimized allocator -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2003-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
#include <bits/functexcept.h>
#include <ext/atomicity.h>
#include <bits/move.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
typedef const _Tp& const_reference;
typedef _Tp value_type;
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
pointer
address(reference __x) const _GLIBCXX_NOEXCEPT
{ return std::__addressof(__x); }
// Allocator that wraps operator new -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-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
#include <new>
#include <bits/functexcept.h>
#include <bits/move.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
struct rebind
{ typedef new_allocator<_Tp1> other; };
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
new_allocator() _GLIBCXX_USE_NOEXCEPT { }
new_allocator(const new_allocator&) _GLIBCXX_USE_NOEXCEPT { }
// Allocators -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-// 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-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
#include <ext/atomicity.h>
#include <ext/concurrence.h>
#include <bits/move.h>
+#if __cplusplus >= 201103L
+#include <type_traits>
+#endif
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
struct rebind
{ typedef __pool_alloc<_Tp1> other; };
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
__pool_alloc() _GLIBCXX_USE_NOEXCEPT { }
__pool_alloc(const __pool_alloc&) _GLIBCXX_USE_NOEXCEPT { }
typedef value_type& reference;
typedef const value_type& const_reference;
+#if __cplusplus >= 201103L
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2103. std::allocator propagate_on_container_move_assignment
+ typedef std::true_type propagate_on_container_move_assignment;
+#endif
+
private:
typedef _Cond condition_type;
_Res _Class::*__pm;
};
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2048. Unnecessary mem_fn overloads
/**
* @brief Returns a function object that forwards to the member
* pointer @a pm.
_M_storage(__future_base::_S_allocate_result<void>(__a))
{ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2095. missing constructors needed for uses-allocator construction
template<typename _Allocator>
promise(allocator_arg_t, const _Allocator&, promise&& __rhs)
: _M_future(std::move(__rhs._M_future)),
// Construction and destruction
packaged_task() noexcept { }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2095. missing constructors needed for uses-allocator construction
template<typename _Allocator>
explicit
packaged_task(allocator_arg_t, const _Allocator& __a) noexcept
: _M_state(std::make_shared<_State_type>(std::forward<_Fn>(__fn)))
{ }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2097. packaged_task constructors should be constrained
template<typename _Fn, typename _Allocator, typename = typename
__constrain_pkgdtask<packaged_task, _Fn>::__type>
explicit
construct(pair<_T1, _T2>* __p, piecewise_construct_t,
tuple<_Args1...> __x, tuple<_Args2...> __y)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2203. wrong argument types for piecewise construction
auto& __inner = inner_allocator();
auto __x_use_tag
= __use_alloc<_T1, inner_allocator_type, _Args1...>(__inner);
public:
thread() noexcept = default;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 2097. packaged_task constructors should be constrained
thread(thread&) = delete;
thread(const thread&) = delete;
--- /dev/null
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 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
+// 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 <memory>
+#include <type_traits>
+
+// Check std::allocator for required typedefs.
+
+using std::is_same;
+using std::allocator;
+
+static_assert( is_same<allocator<int>::size_type, std::size_t>::value,
+ "size_type" );
+static_assert( is_same<allocator<int>::difference_type, std::ptrdiff_t>::value,
+ "difference_type" );
+static_assert( is_same<allocator<int>::pointer, int*>::value,
+ "pointer" );
+static_assert( is_same<allocator<int>::const_pointer, const int*>::value,
+ "const_pointer" );
+static_assert( is_same<allocator<int>::reference, int&>::value,
+ "reference" );
+static_assert( is_same<allocator<int>::const_reference, const int&>::value,
+ "const_reference" );
+static_assert( is_same<allocator<int>::value_type, int>::value,
+ "value_type" );
+
+static_assert( allocator<int>::propagate_on_container_move_assignment::value,
+ "propagate_on_container_move_assignment is true" );
{
const int dummy = 0;
std::bind(&inc, _1)(0); // { dg-error "no match" }
- // { dg-error "rvalue|const" "" { target *-*-* } 1206 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1220 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1234 }
- // { dg-error "rvalue|const" "" { target *-*-* } 1248 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1208 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1222 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1236 }
+ // { dg-error "rvalue|const" "" { target *-*-* } 1250 }
std::bind(&inc, std::ref(dummy))(); // { dg-error "no match" }
}