Patchwork [v3] Update std::forward to N3092

login
register
mail settings
Submitter Paolo Carlini
Date Aug. 5, 2010, 7:35 a.m.
Message ID <4C5A69D6.1060904@oracle.com>
Download mbox | patch
Permalink /patch/60930/
State New
Headers show

Comments

Paolo Carlini - Aug. 5, 2010, 7:35 a.m.
Hi,

committed to mainline.

Paolo.

///////////
2010-08-05  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (forward): Update to N3092.
	(identity): Remove (US 92 is NAD).
	* include/debug/set.h: Fix move constructor to simply use move.
	* include/debug/unordered_map: Likewise.
	* include/debug/multiset.h: Likewise.
	* include/debug/vector: Likewise.
	* include/debug/unordered_set: Likewise.
	* include/debug/deque: Likewise.
	* include/debug/map.h: Likewise.
	* include/debug/string: Likewise.
	* include/debug/list: Likewise.
	* include/debug/multimap.h: Likewise.
	* include/profile/set.h: Likewise.
	* include/profile/unordered_map: Likewise.
	* include/profile/multiset.h: Likewise.
	* include/profile/unordered_set: Likewise.
	* include/profile/vector: Likewise.
	* include/profile/deque: Likewise.
	* include/profile/map.h: Likewise.
	* include/profile/list: Likewise.
	* include/profile/multimap.h: Likewise.
	* include/ext/vstring.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/forward_list.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/unordered_map.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/unordered_set.h: Likewise.
	* include/bits/stl_bvector.h: Likewise.
	* testsuite/20_util/identity/value.cc: Remove
	* testsuite/20_util/identity/requirements/typedefs.cc: Likewise.
	* testsuite/20_util/identity/requirements/explicit_instantiation.cc:
	Likewise.

Patch

Index: include/debug/set.h
===================================================================
--- include/debug/set.h	(revision 162897)
+++ include/debug/set.h	(working copy)
@@ -90,7 +90,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       set(set&& __x)
-      : _Base(std::forward<set>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       set(initializer_list<value_type> __l,
Index: include/debug/unordered_map
===================================================================
--- include/debug/unordered_map	(revision 162897)
+++ include/debug/unordered_map	(working copy)
@@ -93,7 +93,7 @@ 
       : _Base(__x), _Safe_base() { }
 
       unordered_map(unordered_map&& __x)
-      : _Base(std::forward<unordered_map>(__x)), _Safe_base() { }
+      : _Base(std::move(__x)), _Safe_base() { }
 
       unordered_map(initializer_list<value_type> __l,
 		    size_type __n = 10,
@@ -352,7 +352,7 @@ 
       : _Base(__x), _Safe_base() { }
 
       unordered_multimap(unordered_multimap&& __x) 
-      : _Base(std::forward<unordered_multimap>(__x)), _Safe_base() { }
+      : _Base(std::move(__x)), _Safe_base() { }
 
       unordered_multimap(initializer_list<value_type> __l,
 			 size_type __n = 10,
Index: include/debug/multiset.h
===================================================================
--- include/debug/multiset.h	(revision 162897)
+++ include/debug/multiset.h	(working copy)
@@ -90,7 +90,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       multiset(multiset&& __x)
-      : _Base(std::forward<multiset>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       multiset(initializer_list<value_type> __l,
Index: include/debug/vector
===================================================================
--- include/debug/vector	(revision 162897)
+++ include/debug/vector	(working copy)
@@ -108,7 +108,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       vector(vector&& __x)
-      : _Base(std::forward<vector>(__x)), _Safe_base(),
+      : _Base(std::move(__x)), _Safe_base(),
 	_M_guaranteed_capacity(this->size())
       {
 	this->_M_swap(__x);
Index: include/debug/unordered_set
===================================================================
--- include/debug/unordered_set	(revision 162897)
+++ include/debug/unordered_set	(working copy)
@@ -93,7 +93,7 @@ 
       : _Base(__x), _Safe_base() { }
 
       unordered_set(unordered_set&& __x) 
-      : _Base(std::forward<unordered_set>(__x)), _Safe_base() { }
+      : _Base(std::move(__x)), _Safe_base() { }
 
       unordered_set(initializer_list<value_type> __l,
 		    size_type __n = 10,
@@ -348,7 +348,7 @@ 
       : _Base(__x), _Safe_base() { }
 
       unordered_multiset(unordered_multiset&& __x) 
-      : _Base(std::forward<unordered_multiset>(__x)), _Safe_base() { }
+      : _Base(std::move(__x)), _Safe_base() { }
 
       unordered_multiset(initializer_list<value_type> __l,
 			 size_type __n = 10,
Index: include/debug/deque
===================================================================
--- include/debug/deque	(revision 162897)
+++ include/debug/deque	(working copy)
@@ -100,7 +100,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       deque(deque&& __x)
-      : _Base(std::forward<deque>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       deque(initializer_list<value_type> __l,
Index: include/debug/map.h
===================================================================
--- include/debug/map.h	(revision 162897)
+++ include/debug/map.h	(working copy)
@@ -92,7 +92,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       map(map&& __x)
-      : _Base(std::forward<map>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       map(initializer_list<value_type> __l,
Index: include/debug/string
===================================================================
--- include/debug/string	(revision 162897)
+++ include/debug/string	(working copy)
@@ -113,7 +113,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
     basic_string(basic_string&& __str)
-    : _Base(std::forward<_Base>(__str))
+    : _Base(std::move(__str))
     { }
 
     basic_string(std::initializer_list<_CharT> __l,
@@ -153,7 +153,7 @@ 
     basic_string&
     operator=(basic_string&& __str)
     {
-      *static_cast<_Base*>(this) = std::forward<_Base>(__str);
+      *static_cast<_Base*>(this) = std::move(__str);
       this->_M_invalidate_all();
       return *this;
     }
@@ -376,7 +376,7 @@ 
     basic_string&
     assign(basic_string&& __x)
     {
-      _Base::assign(std::forward<_Base>(__x));
+      _Base::assign(std::move(__x));
       this->_M_invalidate_all();
       return *this;
     }
Index: include/debug/list
===================================================================
--- include/debug/list	(revision 162897)
+++ include/debug/list	(working copy)
@@ -101,7 +101,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       list(list&& __x)
-      : _Base(std::forward<list>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       list(initializer_list<value_type> __l,
Index: include/debug/multimap.h
===================================================================
--- include/debug/multimap.h	(revision 162897)
+++ include/debug/multimap.h	(working copy)
@@ -93,7 +93,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       multimap(multimap&& __x)
-      : _Base(std::forward<multimap>(__x)), _Safe_base()
+      : _Base(std::move(__x)), _Safe_base()
       { this->_M_swap(__x); }
 
       multimap(initializer_list<value_type> __l,
Index: include/profile/set.h
===================================================================
--- include/profile/set.h	(revision 162897)
+++ include/profile/set.h	(working copy)
@@ -82,7 +82,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       set(set&& __x)
-      : _Base(std::forward<set>(__x))
+      : _Base(std::move(__x))
       { }
 
       set(initializer_list<value_type> __l,
Index: include/profile/unordered_map
===================================================================
--- include/profile/unordered_map	(revision 162897)
+++ include/profile/unordered_map	(working copy)
@@ -104,7 +104,7 @@ 
       }
 
       unordered_map(unordered_map&& __x)
-      : _Base(std::forward<_Base>(__x)) 
+      : _Base(std::move(__x)) 
       {
         __profcxx_hashtable_construct(this, _Base::bucket_count());
         __profcxx_hashtable_construct2(this);
@@ -339,7 +339,7 @@ 
       }
 
       unordered_multimap(unordered_multimap&& __x)
-      : _Base(std::forward<_Base>(__x))
+      : _Base(std::move(__x))
       {
         __profcxx_hashtable_construct(this, _Base::bucket_count());
       }
Index: include/profile/multiset.h
===================================================================
--- include/profile/multiset.h	(revision 162897)
+++ include/profile/multiset.h	(working copy)
@@ -82,7 +82,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       multiset(multiset&& __x)
-      : _Base(std::forward<multiset>(__x))
+      : _Base(std::move(__x))
       { }
 
       multiset(initializer_list<value_type> __l,
Index: include/profile/unordered_set
===================================================================
--- include/profile/unordered_set	(revision 162897)
+++ include/profile/unordered_set	(working copy)
@@ -103,7 +103,7 @@ 
       }
 
       unordered_set(unordered_set&& __x)
-      : _Base(std::forward<_Base>(__x)) 
+      : _Base(std::move(__x)) 
       { 
         __profcxx_hashtable_construct(this, _Base::bucket_count());
         __profcxx_hashtable_construct2(this);
@@ -328,7 +328,7 @@ 
       }
 
       unordered_multiset(unordered_multiset&& __x)
-      : _Base(std::forward<_Base>(__x))
+      : _Base(std::move(__x))
       {
         __profcxx_hashtable_construct(this, _Base::bucket_count());
       }
Index: include/profile/vector
===================================================================
--- include/profile/vector	(revision 162897)
+++ include/profile/vector	(working copy)
@@ -137,7 +137,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       vector(vector&& __x)
-      : _Base(std::forward<vector>(__x))
+      : _Base(std::move(__x))
       {
         __profcxx_vector_construct(this, this->capacity());
         __profcxx_vector_construct2(this);
Index: include/profile/deque
===================================================================
--- include/profile/deque	(revision 162897)
+++ include/profile/deque	(working copy)
@@ -93,7 +93,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       deque(deque&& __x)
-      : _Base(std::forward<deque>(__x))
+      : _Base(std::move(__x))
       { }
 
       deque(initializer_list<value_type> __l,
Index: include/profile/map.h
===================================================================
--- include/profile/map.h	(revision 162897)
+++ include/profile/map.h	(working copy)
@@ -94,7 +94,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       map(map&& __x)
-      : _Base(std::forward<map>(__x))
+      : _Base(std::move(__x))
       { }
 
       map(initializer_list<value_type> __l,
Index: include/profile/list
===================================================================
--- include/profile/list	(revision 162897)
+++ include/profile/list	(working copy)
@@ -124,7 +124,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       list(list&& __x)
-      : _Base(std::forward<list>(__x))
+      : _Base(std::move(__x))
       { 
         __profcxx_list_construct(this); 
         __profcxx_list_construct2(this); 
Index: include/profile/multimap.h
===================================================================
--- include/profile/multimap.h	(revision 162897)
+++ include/profile/multimap.h	(working copy)
@@ -84,7 +84,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       multimap(multimap&& __x)
-      : _Base(std::forward<multimap>(__x))
+      : _Base(std::move(__x))
       { }
 
       multimap(initializer_list<value_type> __l,
Index: include/ext/vstring.h
===================================================================
--- include/ext/vstring.h	(revision 162897)
+++ include/ext/vstring.h	(working copy)
@@ -155,7 +155,7 @@ 
        *  string.
        */
       __versa_string(__versa_string&& __str)
-      : __vstring_base(std::forward<__vstring_base>(__str)) { }
+      : __vstring_base(std::move(__str)) { }
 
       /**
        *  @brief  Construct string from an initializer list.
Index: include/bits/stl_list.h
===================================================================
--- include/bits/stl_list.h	(revision 162897)
+++ include/bits/stl_list.h	(working copy)
@@ -569,7 +569,7 @@ 
        *  The contents of @a x are a valid, but unspecified %list.
        */
       list(list&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       /**
        *  @brief  Builds a %list from an initializer_list
Index: include/bits/stl_map.h
===================================================================
--- include/bits/stl_map.h	(revision 162897)
+++ include/bits/stl_map.h	(working copy)
@@ -179,7 +179,7 @@ 
        *  The contents of @a x are a valid, but unspecified %map.
        */
       map(map&& __x)
-      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+      : _M_t(std::move(__x._M_t)) { }
 
       /**
        *  @brief  Builds a %map from an initializer_list.
Index: include/bits/stl_set.h
===================================================================
--- include/bits/stl_set.h	(revision 162897)
+++ include/bits/stl_set.h	(working copy)
@@ -197,7 +197,7 @@ 
        *  The contents of @a x are a valid, but unspecified %set.
        */
       set(set&& __x)
-      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+      : _M_t(std::move(__x._M_t)) { }
 
       /**
        *  @brief  Builds a %set from an initializer_list.
Index: include/bits/forward_list.h
===================================================================
--- include/bits/forward_list.h	(revision 162897)
+++ include/bits/forward_list.h	(working copy)
@@ -452,7 +452,7 @@ 
        *  @param  al    An allocator object.
        */
       forward_list(forward_list&& __list, const _Alloc& __al)
-      : _Base(std::forward<_Base>(__list), __al)
+      : _Base(std::move(__list), __al)
       { }
 
       /**
@@ -523,7 +523,7 @@ 
        *  %forward_list.
        */
       forward_list(forward_list&& __list)
-      : _Base(std::forward<_Base>(__list)) { }
+      : _Base(std::move(__list)) { }
 
       /**
        *  @brief  Builds a %forward_list from an initializer_list
Index: include/bits/move.h
===================================================================
--- include/bits/move.h	(revision 162897)
+++ include/bits/move.h	(working copy)
@@ -50,38 +50,18 @@ 
 #include <type_traits> // Brings in std::declval too.
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
+  
+  /// forward
+  template<typename _Tp, typename _Up>
+    inline typename
+    enable_if<((std::is_convertible<
+		typename std::remove_reference<_Up>::type*,
+		typename std::remove_reference<_Tp>::type*>::value)
+	       && (!std::is_lvalue_reference<_Tp>::value
+		   || std::is_lvalue_reference<_Up>::value)), _Tp&&>::type
+    forward(_Up&& __u)
+    { return static_cast<_Tp&&>(__u); }
 
-  /// identity
-  template<typename _Tp>
-    struct identity
-    {
-      typedef _Tp type;
-    };
-
-  /// forward (as per N2835)
-  /// Forward lvalues as rvalues.
-  template<typename _Tp>
-    inline typename enable_if<!is_lvalue_reference<_Tp>::value, _Tp&&>::type
-    forward(typename std::identity<_Tp>::type& __t)
-    { return static_cast<_Tp&&>(__t); }
-
-  /// Forward rvalues as rvalues.
-  template<typename _Tp>
-    inline typename enable_if<!is_lvalue_reference<_Tp>::value, _Tp&&>::type
-    forward(typename std::identity<_Tp>::type&& __t)
-    { return static_cast<_Tp&&>(__t); }
-
-  // Forward lvalues as lvalues.
-  template<typename _Tp>
-    inline typename enable_if<is_lvalue_reference<_Tp>::value, _Tp>::type
-    forward(typename std::identity<_Tp>::type __t)
-    { return __t; }
-
-  // Prevent forwarding rvalues as const lvalues.
-  template<typename _Tp>
-    inline typename enable_if<is_lvalue_reference<_Tp>::value, _Tp>::type
-    forward(typename std::remove_reference<_Tp>::type&& __t) = delete;
-
   /**
    *  @brief Move a value.
    *  @ingroup mutating_algorithms
@@ -109,10 +89,10 @@ 
 
 _GLIBCXX_END_NAMESPACE
 
-#define _GLIBCXX_MOVE(_Tp) std::move(_Tp)
+#define _GLIBCXX_MOVE(__val) std::move(__val)
 #define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
 #else
-#define _GLIBCXX_MOVE(_Tp) (_Tp)
+#define _GLIBCXX_MOVE(__val) (__val)
 #define _GLIBCXX_FORWARD(_Tp, __val) (__val)
 #endif
 
Index: include/bits/stl_multimap.h
===================================================================
--- include/bits/stl_multimap.h	(revision 162897)
+++ include/bits/stl_multimap.h	(working copy)
@@ -177,7 +177,7 @@ 
        *  The contents of @a x are a valid, but unspecified %multimap.
        */
       multimap(multimap&& __x)
-      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+      : _M_t(std::move(__x._M_t)) { }
 
       /**
        *  @brief  Builds a %multimap from an initializer_list.
Index: include/bits/unordered_map.h
===================================================================
--- include/bits/unordered_map.h	(revision 162897)
+++ include/bits/unordered_map.h	(working copy)
@@ -85,7 +85,7 @@ 
       __unordered_map(const __unordered_map& __x) = default;
 
       __unordered_map(__unordered_map&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
     };
   
   template<class _Key, class _Tp,
@@ -142,7 +142,7 @@ 
       __unordered_multimap(const __unordered_multimap& __x) = default;
 
       __unordered_multimap(__unordered_multimap&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
     };
 
   template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc,
@@ -253,7 +253,7 @@ 
       unordered_map(const unordered_map& __x) = default;
 
       unordered_map(unordered_map&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       unordered_map(initializer_list<value_type> __l,
 		    size_type __n = 10,
@@ -340,7 +340,7 @@ 
       unordered_multimap(const unordered_multimap& __x) = default;
 
       unordered_multimap(unordered_multimap&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       unordered_multimap(initializer_list<value_type> __l,
 			 size_type __n = 10,
Index: include/bits/stl_vector.h
===================================================================
--- include/bits/stl_vector.h	(revision 162897)
+++ include/bits/stl_vector.h	(working copy)
@@ -290,7 +290,7 @@ 
        *  The contents of @a x are a valid, but unspecified %vector.
        */
       vector(vector&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       /**
        *  @brief  Builds a %vector from an initializer list.
Index: include/bits/stl_deque.h
===================================================================
--- include/bits/stl_deque.h	(revision 162897)
+++ include/bits/stl_deque.h	(working copy)
@@ -839,8 +839,8 @@ 
        *  The newly-created %deque contains the exact contents of @a x.
        *  The contents of @a x are a valid, but unspecified %deque.
        */
-      deque(deque&&  __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      deque(deque&& __x)
+      : _Base(std::move(__x)) { }
 
       /**
        *  @brief  Builds a %deque from an initializer list.
Index: include/bits/stl_multiset.h
===================================================================
--- include/bits/stl_multiset.h	(revision 162897)
+++ include/bits/stl_multiset.h	(working copy)
@@ -190,7 +190,7 @@ 
        *  The contents of @a x are a valid, but unspecified %multiset.
        */
       multiset(multiset&& __x)
-      : _M_t(std::forward<_Rep_type>(__x._M_t)) { }
+      : _M_t(std::move(__x._M_t)) { }
 
       /**
        *  @brief  Builds a %multiset from an initializer_list.
Index: include/bits/unordered_set.h
===================================================================
--- include/bits/unordered_set.h	(revision 162897)
+++ include/bits/unordered_set.h	(working copy)
@@ -85,7 +85,7 @@ 
       __unordered_set(const __unordered_set& __x) = default;
 
       __unordered_set(__unordered_set&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
     };
 
   template<class _Value,
@@ -140,7 +140,7 @@ 
       __unordered_multiset(const __unordered_multiset& __x) = default;
 
       __unordered_multiset(__unordered_multiset&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
     };
 
   template<class _Value, class _Hash, class _Pred, class _Alloc,
@@ -246,7 +246,7 @@ 
       unordered_set(const unordered_set& __x) = default;
 
       unordered_set(unordered_set&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       unordered_set(initializer_list<value_type> __l,
 		    size_type __n = 10,
@@ -330,7 +330,7 @@ 
       unordered_multiset(const unordered_multiset& __x) = default;
 
       unordered_multiset(unordered_multiset&& __x)
-      : _Base(std::forward<_Base>(__x)) { }
+      : _Base(std::move(__x)) { }
 
       unordered_multiset(initializer_list<value_type> __l,
 			 size_type __n = 10,
Index: include/bits/stl_bvector.h
===================================================================
--- include/bits/stl_bvector.h	(revision 162897)
+++ include/bits/stl_bvector.h	(working copy)
@@ -528,7 +528,7 @@ 
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
     vector(vector&& __x)
-    : _Base(std::forward<_Base>(__x)) { }
+    : _Base(std::move(__x)) { }
 
     vector(initializer_list<bool> __l,
 	   const allocator_type& __a = allocator_type())
Index: testsuite/20_util/identity/value.cc
===================================================================
--- testsuite/20_util/identity/value.cc	(revision 162897)
+++ testsuite/20_util/identity/value.cc	(working copy)
@@ -1,47 +0,0 @@ 
-// { dg-options "-std=gnu++0x" }
-// 2007-07-10  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 2007, 2009 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 <utility>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::identity;
-  using std::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<identity<int>::type, int>::value) );
-  VERIFY( (is_same<identity<int&>::type, int&>::value) );
-  VERIFY( (is_same<identity<int&&>::type, int&&>::value) );
-  VERIFY( (is_same<identity<int*>::type, int*>::value) );
-  VERIFY( (is_same<identity<ClassType&&>::type, ClassType&&>::value) );
-  VERIFY( (is_same<identity<ClassType>::type, ClassType>::value) );
-  VERIFY( (is_same<identity<int(int)>::type, int(int)>::value) );
-  VERIFY( (is_same<identity<void>::type, void>::value) );
-  VERIFY( (is_same<identity<const void>::type, const void>::value) );  
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
Index: testsuite/20_util/identity/requirements/typedefs.cc
===================================================================
--- testsuite/20_util/identity/requirements/typedefs.cc	(revision 162897)
+++ testsuite/20_util/identity/requirements/typedefs.cc	(working copy)
@@ -1,33 +0,0 @@ 
-// { dg-options "-std=gnu++0x" }
-// 2007-07-10  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 2007, 2009 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/>.
-
-// 
-// NB: This file is for testing utility with NO OTHER INCLUDES.
-
-#include <utility>
-
-// { dg-do compile }
-
-void test01()
-{
-  // Check for required typedefs
-  typedef std::identity<int>                  test_type;
-  typedef test_type::type                     type;
-}
Index: testsuite/20_util/identity/requirements/explicit_instantiation.cc
===================================================================
--- testsuite/20_util/identity/requirements/explicit_instantiation.cc	(revision 162897)
+++ testsuite/20_util/identity/requirements/explicit_instantiation.cc	(working copy)
@@ -1,32 +0,0 @@ 
-// { dg-options "-std=gnu++0x" }
-// { dg-do compile }
-
-// 2007-07-10  Paolo Carlini  <pcarlini@suse.de>
-
-// Copyright (C) 2007, 2009 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/>.
-
-
-// NB: This file is for testing utility with NO OTHER INCLUDES.
-
-#include <utility>
-
-namespace std
-{
-  typedef short test_type;
-  template struct decay<test_type>;
-}