type_traits (is_reference, [...]): Remove.
authorPaolo Carlini <pcarlini@suse.de>
Sat, 2 Jun 2007 17:24:09 +0000 (17:24 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 2 Jun 2007 17:24:09 +0000 (17:24 +0000)
2007-06-02  Paolo Carlini  <pcarlini@suse.de>

* include/tr1_impl/type_traits (is_reference, add_reference,
remove_reference): Remove.
* include/tr1/type_traits (is_reference, add_reference,
remove_reference): Add.
* include/std/type_traits (is_lvalue_reference, is_rvalue_reference,
is_reference, remove_reference, add_lvalue_reference,
add_rvalue_reference): Add.
* include/tr1_impl/boost_shared_ptr.h (operator*): Adjust.
* testsuite/20_util/add_lvalue_reference/requirements/
explicit_instantiation.cc: New.
* testsuite/20_util/add_lvalue_reference/value.cc: Likewise.
* testsuite/20_util/add_rvalue_reference/requirements/
explicit_instantiation.cc: Likewise.
* testsuite/20_util/add_rvalue_reference/value.cc: Likewise.
* testsuite/20_util/is_lvalue_reference/requirements/
explicit_instantiation.cc: Likewise.
* testsuite/20_util/is_lvalue_reference/requirements/
typedefs.cc: Likewise.
* testsuite/20_util/is_lvalue_reference/value.cc: Likewise.
* testsuite/20_util/is_rvalue_reference/requirements/
explicit_instantiation.cc: Likewise.
* testsuite/20_util/is_rvalue_reference/requirements/
typedefs.cc: Likewise.
* testsuite/20_util/is_rvalue_reference/value.cc: Likewise.
* testsuite/20_util/is_reference/requirements/
explicit_instantiation.cc: Likewise.
* testsuite/20_util/is_reference/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_reference/value.cc: Likewise.
* testsuite/20_util/remove_reference/requirements/
explicit_instantiation.cc: New.
* testsuite/20_util/remove_reference/value.cc: Likewise.

* testsuite/tr1/4_metaprogramming/add_const/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/add_const/value.cc: ... here.
* testsuite/tr1/4_metaprogramming/add_cv/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/add_cv/value.cc: ... here.
* testsuite/tr1/4_metaprogramming/add_pointer/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/add_pointer/value.cc: ... here.
* testsuite/tr1/4_metaprogramming/add_reference/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/add_reference/value.cc: ... here.
* testsuite/tr1/4_metaprogramming/add_volatile/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/add_volatile/value.cc: ... here.
* testsuite/tr1/4_metaprogramming/aligned_storage/requirements/
typedefs.cc: Move...
* testsuite/tr1/4_metaprogramming/aligned_storage/value.cc: ... here.

From-SVN: r125283

34 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/tr1/type_traits
libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
libstdc++-v3/include/tr1_impl/type_traits
libstdc++-v3/testsuite/20_util/add_lvalue_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/add_rvalue_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_reference/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/typedefs.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
libstdc++-v3/testsuite/20_util/remove_reference/requirements/explicit_instantiation.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/remove_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc [deleted file]
libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc [new file with mode: 0644]

index 45d9f203ca1e35f9256c5904ae832031d9ddc3f7..4655e73aa01894c21c56b31ba28b26924e33b363 100644 (file)
@@ -1,3 +1,56 @@
+2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1_impl/type_traits (is_reference, add_reference,
+       remove_reference): Remove.
+       * include/tr1/type_traits (is_reference, add_reference,
+       remove_reference): Add.
+       * include/std/type_traits (is_lvalue_reference, is_rvalue_reference,
+       is_reference, remove_reference, add_lvalue_reference,
+       add_rvalue_reference): Add.
+       * include/tr1_impl/boost_shared_ptr.h (operator*): Adjust.
+       * testsuite/20_util/add_lvalue_reference/requirements/
+       explicit_instantiation.cc: New.
+       * testsuite/20_util/add_lvalue_reference/value.cc: Likewise.
+       * testsuite/20_util/add_rvalue_reference/requirements/
+       explicit_instantiation.cc: Likewise.
+       * testsuite/20_util/add_rvalue_reference/value.cc: Likewise.
+       * testsuite/20_util/is_lvalue_reference/requirements/
+       explicit_instantiation.cc: Likewise.
+       * testsuite/20_util/is_lvalue_reference/requirements/
+       typedefs.cc: Likewise.
+       * testsuite/20_util/is_lvalue_reference/value.cc: Likewise.
+       * testsuite/20_util/is_rvalue_reference/requirements/
+       explicit_instantiation.cc: Likewise.
+       * testsuite/20_util/is_rvalue_reference/requirements/
+       typedefs.cc: Likewise.
+       * testsuite/20_util/is_rvalue_reference/value.cc: Likewise.
+       * testsuite/20_util/is_reference/requirements/
+       explicit_instantiation.cc: Likewise.
+       * testsuite/20_util/is_reference/requirements/typedefs.cc: Likewise.
+       * testsuite/20_util/is_reference/value.cc: Likewise.
+       * testsuite/20_util/remove_reference/requirements/
+       explicit_instantiation.cc: New.
+       * testsuite/20_util/remove_reference/value.cc: Likewise.
+
+       * testsuite/tr1/4_metaprogramming/add_const/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/add_const/value.cc: ... here.
+       * testsuite/tr1/4_metaprogramming/add_cv/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/add_cv/value.cc: ... here.
+       * testsuite/tr1/4_metaprogramming/add_pointer/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/add_pointer/value.cc: ... here.
+       * testsuite/tr1/4_metaprogramming/add_reference/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/add_reference/value.cc: ... here.
+       * testsuite/tr1/4_metaprogramming/add_volatile/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/add_volatile/value.cc: ... here.
+       * testsuite/tr1/4_metaprogramming/aligned_storage/requirements/
+       typedefs.cc: Move...
+       * testsuite/tr1/4_metaprogramming/aligned_storage/value.cc: ... here.
+
 2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure: Regenerate.
index 8dbfb5622959fca929ca0d363f6f672f4baa6c1d..5113184795a0d3bb00a0c2b9ffa90971f48d21b5 100644 (file)
 
 namespace std
 {
+  // Primary classification traits.
+  template<typename>
+    struct is_lvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_lvalue_reference<_Tp&>
+    : public true_type { };
+
+  template<typename>
+    struct is_rvalue_reference
+    : public false_type { };
+
+  template<typename _Tp>
+    struct is_rvalue_reference<_Tp&&>
+    : public true_type { };
+
+  // Secondary classification traits.
+  template<typename _Tp>
+    struct is_reference
+    : public integral_constant<bool, (is_lvalue_reference<_Tp>::value
+                                     || is_rvalue_reference<_Tp>::value)>
+    { };
+
+  // Reference transformations.
+  template<typename _Tp>
+    struct remove_reference
+    { typedef _Tp   type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&>
+    { typedef _Tp   type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&&>
+    { typedef _Tp   type; };
+
+  template<typename _Tp,
+          bool = is_object<_Tp>::value || is_function<_Tp>::value,
+          bool = is_rvalue_reference<_Tp>::value>
+    struct __add_lvalue_reference_helper
+    { typedef _Tp   type; };
+
+  template<typename _Tp>
+    struct __add_lvalue_reference_helper<_Tp, true, false>
+    { typedef _Tp&   type; };
+
+  template<typename _Tp>
+    struct __add_lvalue_reference_helper<_Tp, false, true>
+    { typedef typename remove_reference<_Tp>::type&   type; };
+
+  template<typename _Tp>
+    struct add_lvalue_reference
+    : public __add_lvalue_reference_helper<_Tp>
+    { };
+
+  template<typename _Tp,
+          bool = is_object<_Tp>::value || is_function<_Tp>::value>
+    struct __add_rvalue_reference_helper
+    { typedef _Tp   type; };
+
+  template<typename _Tp>
+    struct __add_rvalue_reference_helper<_Tp, true>
+    { typedef _Tp&&   type; };
+
+  template<typename _Tp>
+    struct add_rvalue_reference
+    : public __add_rvalue_reference_helper<_Tp>
+    { };
+
+  // Scalar properties and transformations.
   template<typename _Tp,
           bool = is_integral<_Tp>::value,
           bool = is_floating_point<_Tp>::value>
@@ -88,6 +159,7 @@ namespace std
                                      && !is_signed<_Tp>::value)>
     { };
 
+  // Member introspection.
   template<typename _Tp>
     struct is_pod
     : public integral_constant<bool, __is_pod(_Tp)>
@@ -133,8 +205,7 @@ namespace std
     : public integral_constant<bool, __is_base_of(_Base, _Derived)>
     { };
 
-  // XXX FIXME
-  // The C++0x specifications are different, see N2255.
+  // Relationships between types.
   template<typename _From, typename _To>
     struct __is_convertible_simple
     : public __sfinae_types
@@ -178,6 +249,8 @@ namespace std
                                   || (__is_int_or_cref<_To>::__value
                                       && !is_void<_From>::value)); };
 
+  // XXX FIXME
+  // The C++0x specifications are different, see N2255.
   template<typename _From, typename _To>
     struct is_convertible
     : public integral_constant<bool,
index 709cbd9bb17144ba80b3bb648d024ad3293e62b0..b9b60cfbda13318ff0bbcd8fcca57b25b061d178 100644 (file)
@@ -75,22 +75,12 @@ namespace tr1
   _DEFINE_SPEC_##_Order##_HELPER(_Trait<_Type const volatile>, _Value)
 
   template<typename>
-    struct is_signed
+    struct is_reference
     : public false_type { };
-  _DEFINE_SPEC(0, is_signed, signed char, true)
-  _DEFINE_SPEC(0, is_signed, short, true)
-  _DEFINE_SPEC(0, is_signed, int, true)
-  _DEFINE_SPEC(0, is_signed, long, true)
-  _DEFINE_SPEC(0, is_signed, long long, true)
 
-  template<typename>
-    struct is_unsigned
-    : public false_type { };
-  _DEFINE_SPEC(0, is_unsigned, unsigned char, true)
-  _DEFINE_SPEC(0, is_unsigned, unsigned short, true)
-  _DEFINE_SPEC(0, is_unsigned, unsigned int, true)
-  _DEFINE_SPEC(0, is_unsigned, unsigned long, true)
-  _DEFINE_SPEC(0, is_unsigned, unsigned long long, true)
+  template<typename _Tp>
+    struct is_reference<_Tp&>
+    : public true_type { };
 
   template<typename _Tp>
     struct is_pod
@@ -132,6 +122,24 @@ namespace tr1
     : public integral_constant<bool, is_pod<_Tp>::value>
     { };
 
+  template<typename>
+    struct is_signed
+    : public false_type { };
+  _DEFINE_SPEC(0, is_signed, signed char, true)
+  _DEFINE_SPEC(0, is_signed, short, true)
+  _DEFINE_SPEC(0, is_signed, int, true)
+  _DEFINE_SPEC(0, is_signed, long, true)
+  _DEFINE_SPEC(0, is_signed, long long, true)
+
+  template<typename>
+    struct is_unsigned
+    : public false_type { };
+  _DEFINE_SPEC(0, is_unsigned, unsigned char, true)
+  _DEFINE_SPEC(0, is_unsigned, unsigned short, true)
+  _DEFINE_SPEC(0, is_unsigned, unsigned int, true)
+  _DEFINE_SPEC(0, is_unsigned, unsigned long, true)
+  _DEFINE_SPEC(0, is_unsigned, unsigned long long, true)
+
   template<typename _Base, typename _Derived>
     struct __is_base_of_helper
     {
@@ -198,6 +206,30 @@ namespace tr1
                               __is_convertible_helper<_From, _To>::__value>
     { };
 
+  /// @brief  reference modifications [4.7.2].
+  template<typename _Tp>
+    struct remove_reference
+    { typedef _Tp     type; };
+
+  template<typename _Tp>
+    struct remove_reference<_Tp&>
+    { typedef _Tp     type; };
+
+  // NB: Careful with reference to void.
+  template<typename _Tp, bool = (is_void<_Tp>::value
+                                || is_reference<_Tp>::value)>
+    struct __add_reference_helper
+    { typedef _Tp&    type; };
+
+  template<typename _Tp>
+    struct __add_reference_helper<_Tp, true>
+    { typedef _Tp     type; };
+
+  template<typename _Tp>
+    struct add_reference
+    : public __add_reference_helper<_Tp>
+    { };
+
 #undef _DEFINE_SPEC_0_HELPER
 #undef _DEFINE_SPEC
 #undef _DEFINE_SPEC_BODY
index 1a1af5ccd778ae2eaa38652127e8af05c91332de..d211055c58ad34948f7ae2abfba5b69d88f27414 100644 (file)
@@ -647,7 +647,11 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
         { __shared_ptr(__p, __d).swap(*this); }
 
       // Allow class instantiation when _Tp is [cv-qual] void.
-      typename add_reference<_Tp>::type
+#ifdef _GLIBCXX_INCLUDE_AS_CXX0X
+      typename std::add_lvalue_reference<_Tp>::type
+#else
+      typename std::tr1::add_reference<_Tp>::type
+#endif
       operator*() const // never throws
       {
        _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
index 9fa77caeff8908619285f84d07a72cac56428cc4..9035fafece374824a34cb0c515bd5378e96e9f4b 100644 (file)
@@ -132,14 +132,6 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
     : public false_type { };
   _DEFINE_SPEC(1, is_pointer, _Tp*, true)
  
-  template<typename>
-    struct is_reference
-    : public false_type { };
-
-  template<typename _Tp>
-    struct is_reference<_Tp&>
-    : public true_type { };
-
   template<typename>
     struct is_member_object_pointer
     : public false_type { };
@@ -343,30 +335,6 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       add_const<typename add_volatile<_Tp>::type>::type     type;
     };
 
-  /// @brief  reference modifications [4.7.2].
-  template<typename _Tp>
-    struct remove_reference
-    { typedef _Tp     type; };
-
-  template<typename _Tp>
-    struct remove_reference<_Tp&>
-    { typedef _Tp     type; };
-
-  // NB: Careful with reference to void.
-  template<typename _Tp, bool = (is_void<_Tp>::value
-                                || is_reference<_Tp>::value)>
-    struct __add_reference_helper
-    { typedef _Tp&    type; };
-
-  template<typename _Tp>
-    struct __add_reference_helper<_Tp, true>
-    { typedef _Tp     type; };
-
-  template<typename _Tp>
-    struct add_reference
-    : public __add_reference_helper<_Tp>
-    { };
-
   /// @brief  array modifications [4.7.3].
   template<typename _Tp>
     struct remove_extent
diff --git a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..3eefabc
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct add_lvalue_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc
new file mode 100644 (file)
index 0000000..b4f4be4
--- /dev/null
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::add_lvalue_reference;
+  using std::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_lvalue_reference<int>::type, int&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<int&>::type, int&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<const int>::type, const int&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<int*>::type, int*&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<ClassType&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<ClassType>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<int(int)>::type, int(&)(int)>::value) );  
+  VERIFY( (is_same<add_lvalue_reference<int&&>::type, int&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<ClassType&&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_lvalue_reference<void>::type, void>::value) );
+  VERIFY( (is_same<add_lvalue_reference<const void>::type, const void>::value) );  
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..6dd1f9b
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct add_rvalue_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc
new file mode 100644 (file)
index 0000000..2709915
--- /dev/null
@@ -0,0 +1,48 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::add_rvalue_reference;
+  using std::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_rvalue_reference<int>::type, int&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<int&&>::type, int&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<const int>::type, const int&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<int*>::type, int*&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<ClassType&&>::type, ClassType&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<ClassType>::type, ClassType&&>::value) );
+  VERIFY( (is_same<add_rvalue_reference<int(int)>::type, int(&&)(int)>::value) );
+  VERIFY( (is_same<add_rvalue_reference<void>::type, void>::value) );
+  VERIFY( (is_same<add_rvalue_reference<const void>::type, const void>::value) );  
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..a2c928e
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct is_lvalue_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..7315244
--- /dev/null
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+  // Check for required typedefs
+  typedef std::is_lvalue_reference<int>       test_type;
+  typedef test_type::value_type               value_type;
+  typedef test_type::type                     type;
+  typedef test_type::type::value_type         type_value_type;
+  typedef test_type::type::type               type_type;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc
new file mode 100644 (file)
index 0000000..a80e606
--- /dev/null
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::is_lvalue_reference;
+  using namespace __gnu_test;
+
+  VERIFY( (test_category<is_lvalue_reference, int&>(true)) );
+  VERIFY( (test_category<is_lvalue_reference, ClassType&>(true)) );
+  VERIFY( (test_category<is_lvalue_reference, int(&)(int)>(true)) );
+
+  // Sanity check.
+  VERIFY( (test_category<is_lvalue_reference, int&&>(false)) );
+  VERIFY( (test_category<is_lvalue_reference, ClassType>(false)) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..4cf4570
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct is_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_reference/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..5ad8587
--- /dev/null
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+  // Check for required typedefs
+  typedef std::is_reference<int>              test_type;
+  typedef test_type::value_type               value_type;
+  typedef test_type::type                     type;
+  typedef test_type::type::value_type         type_value_type;
+  typedef test_type::type::type               type_type;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_reference/value.cc
new file mode 100644 (file)
index 0000000..af425c1
--- /dev/null
@@ -0,0 +1,47 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::is_reference;
+  using namespace __gnu_test;
+
+  VERIFY( (test_category<is_reference, int&>(true)) );
+  VERIFY( (test_category<is_reference, ClassType&>(true)) );
+  VERIFY( (test_category<is_reference, int(&)(int)>(true)) );
+  VERIFY( (test_category<is_reference, int&&>(true)) );
+  VERIFY( (test_category<is_reference, ClassType&&>(true)) );
+  VERIFY( (test_category<is_reference, int(&&)(int)>(true)) );
+
+  // Sanity check.
+  VERIFY( (test_category<is_reference, ClassType>(false)) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..f4f45bf
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct is_rvalue_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/typedefs.cc
new file mode 100644 (file)
index 0000000..5e3d68c
--- /dev/null
@@ -0,0 +1,37 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+  // Check for required typedefs
+  typedef std::is_rvalue_reference<int>       test_type;
+  typedef test_type::value_type               value_type;
+  typedef test_type::type                     type;
+  typedef test_type::type::value_type         type_value_type;
+  typedef test_type::type::type               type_type;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc
new file mode 100644 (file)
index 0000000..55f76d6
--- /dev/null
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::is_rvalue_reference;
+  using namespace __gnu_test;
+
+  VERIFY( (test_category<is_rvalue_reference, int&&>(true)) );
+  VERIFY( (test_category<is_rvalue_reference, ClassType&&>(true)) );
+  VERIFY( (test_category<is_rvalue_reference, int(&&)(int)>(true)) );
+
+  // Sanity check.
+  VERIFY( (test_category<is_rvalue_reference, int&>(false)) );
+  VERIFY( (test_category<is_rvalue_reference, ClassType>(false)) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 044f979ab676546d2f7d3a7f994f5110863748ad..db34e04c1715e5e5ef0de1aa16fafece8e0a2fd5 100644 (file)
@@ -49,8 +49,8 @@ void test01()
 // { dg-error "instantiated from here" "" { target *-*-* } 41 }
 // { dg-error "instantiated from here" "" { target *-*-* } 43 }
 
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 424 }
-// { dg-error "declaration of" "" { target *-*-* } 390 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 497 }
+// { dg-error "declaration of" "" { target *-*-* } 463 }
 
 // { dg-excess-errors "At global scope" }
 // { dg-excess-errors "In instantiation of" }
index f12d941616a9ce4ed515488862a473812714b283..e64c0e2501eb631cf9304d9698fd6cadfa056708 100644 (file)
@@ -49,8 +49,8 @@ void test01()
 // { dg-error "instantiated from here" "" { target *-*-* } 41 }
 // { dg-error "instantiated from here" "" { target *-*-* } 43 }
 
-// { dg-error "invalid use of incomplete type" "" { target *-*-* } 345 }
-// { dg-error "declaration of" "" { target *-*-* } 311 }
+// { dg-error "invalid use of incomplete type" "" { target *-*-* } 418 }
+// { dg-error "declaration of" "" { target *-*-* } 384 }
 
 // { dg-excess-errors "At global scope" }
 // { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/remove_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/remove_reference/requirements/explicit_instantiation.cc
new file mode 100644 (file)
index 0000000..cbe29c5
--- /dev/null
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+  typedef short test_type;
+  template struct remove_reference<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/remove_reference/value.cc b/libstdc++-v3/testsuite/20_util/remove_reference/value.cc
new file mode 100644 (file)
index 0000000..00e2574
--- /dev/null
@@ -0,0 +1,53 @@
+// { dg-options "-std=gnu++0x" }
+// 2007-06-02  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::remove_reference;
+  using std::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<remove_reference<int&>::type, int>::value) );
+  VERIFY( (is_same<remove_reference<int>::type, int>::value) );
+  VERIFY( (is_same<remove_reference<const int&>::type, const int>::value) );
+  VERIFY( (is_same<remove_reference<int*&>::type, int*>::value) );
+  VERIFY( (is_same<remove_reference<ClassType&>::type, ClassType>::value) );
+  VERIFY( (is_same<remove_reference<ClassType>::type, ClassType>::value) );
+  VERIFY( (is_same<remove_reference<int(&)(int)>::type, int(int)>::value) );
+  VERIFY( (is_same<remove_reference<int&&>::type, int>::value) );
+  VERIFY( (is_same<remove_reference<int>::type, int>::value) );
+  VERIFY( (is_same<remove_reference<const int&&>::type, const int>::value) );
+  VERIFY( (is_same<remove_reference<int*&&>::type, int*>::value) );
+  VERIFY( (is_same<remove_reference<ClassType&&>::type, ClassType>::value) );
+  VERIFY( (is_same<remove_reference<ClassType>::type, ClassType>::value) );
+  VERIFY( (is_same<remove_reference<int(&&)(int)>::type, int(int)>::value) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/typedefs.cc
deleted file mode 100644 (file)
index 8669098..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.7.1 Const-volatile modifications
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::add_const;
-  using std::tr1::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<add_const<int>::type, const int>::value) );
-  VERIFY( (is_same<add_const<volatile int>::type, const volatile int>::value) );
-  VERIFY( (is_same<add_const<int*>::type, int* const>::value) );
-  VERIFY( (is_same<add_const<int&>::type, int&>::value) );
-  VERIFY( (is_same<add_const<int (int)>::type, int (int)>::value) );
-  VERIFY( (is_same<add_const<const int>::type, const int>::value) );
-  VERIFY( (is_same<add_const<ClassType>::type, const ClassType>::value) );
-  VERIFY( (is_same<add_const<volatile ClassType>::type,
-          const volatile ClassType>::value) );
-  VERIFY( (is_same<add_const<ClassType*>::type, ClassType* const>::value) );
-  VERIFY( (is_same<add_const<ClassType&>::type, ClassType&>::value) );
-  VERIFY( (is_same<add_const<ClassType (ClassType)>::type,
-          ClassType (ClassType)>::value) );
-  VERIFY( (is_same<add_const<const ClassType>::type, const ClassType>::value) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc
new file mode 100644 (file)
index 0000000..2b0c132
--- /dev/null
@@ -0,0 +1,54 @@
+// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.7.1 Const-volatile modifications
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::add_const;
+  using std::tr1::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_const<int>::type, const int>::value) );
+  VERIFY( (is_same<add_const<volatile int>::type, const volatile int>::value) );
+  VERIFY( (is_same<add_const<int*>::type, int* const>::value) );
+  VERIFY( (is_same<add_const<int&>::type, int&>::value) );
+  VERIFY( (is_same<add_const<int (int)>::type, int (int)>::value) );
+  VERIFY( (is_same<add_const<const int>::type, const int>::value) );
+  VERIFY( (is_same<add_const<ClassType>::type, const ClassType>::value) );
+  VERIFY( (is_same<add_const<volatile ClassType>::type,
+          const volatile ClassType>::value) );
+  VERIFY( (is_same<add_const<ClassType*>::type, ClassType* const>::value) );
+  VERIFY( (is_same<add_const<ClassType&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_const<ClassType (ClassType)>::type,
+          ClassType (ClassType)>::value) );
+  VERIFY( (is_same<add_const<const ClassType>::type, const ClassType>::value) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc
deleted file mode 100644 (file)
index c197501..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.7.1 Const-volatile modifications
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::add_cv;
-  using std::tr1::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<add_cv<int>::type, const volatile int>::value) );
-  VERIFY( (is_same<add_cv<const int>::type, const volatile int>::value) );
-  VERIFY( (is_same<add_cv<int*>::type, int* const volatile>::value) );
-  VERIFY( (is_same<add_cv<int&>::type, int&>::value) );
-  VERIFY( (is_same<add_cv<int (int)>::type, int (int)>::value) );
-  VERIFY( (is_same<add_cv<const volatile int>::type,
-          const volatile int>::value) );
-  VERIFY( (is_same<add_cv<ClassType>::type, const volatile ClassType>::value) );
-  VERIFY( (is_same<add_cv<volatile ClassType>::type,
-          const volatile ClassType>::value) );
-  VERIFY( (is_same<add_cv<ClassType*>::type,
-          ClassType* const volatile>::value) );
-  VERIFY( (is_same<add_cv<ClassType&>::type, ClassType&>::value) );
-  VERIFY( (is_same<add_cv<ClassType (ClassType)>::type,
-          ClassType (ClassType)>::value) );
-  VERIFY( (is_same<add_cv<const volatile ClassType>::type,
-          const volatile ClassType>::value) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc
new file mode 100644 (file)
index 0000000..2fa2c2a
--- /dev/null
@@ -0,0 +1,57 @@
+// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.7.1 Const-volatile modifications
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::add_cv;
+  using std::tr1::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_cv<int>::type, const volatile int>::value) );
+  VERIFY( (is_same<add_cv<const int>::type, const volatile int>::value) );
+  VERIFY( (is_same<add_cv<int*>::type, int* const volatile>::value) );
+  VERIFY( (is_same<add_cv<int&>::type, int&>::value) );
+  VERIFY( (is_same<add_cv<int (int)>::type, int (int)>::value) );
+  VERIFY( (is_same<add_cv<const volatile int>::type,
+          const volatile int>::value) );
+  VERIFY( (is_same<add_cv<ClassType>::type, const volatile ClassType>::value) );
+  VERIFY( (is_same<add_cv<volatile ClassType>::type,
+          const volatile ClassType>::value) );
+  VERIFY( (is_same<add_cv<ClassType*>::type,
+          ClassType* const volatile>::value) );
+  VERIFY( (is_same<add_cv<ClassType&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_cv<ClassType (ClassType)>::type,
+          ClassType (ClassType)>::value) );
+  VERIFY( (is_same<add_cv<const volatile ClassType>::type,
+          const volatile ClassType>::value) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc
deleted file mode 100644 (file)
index d87cd2e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// 2004-12-12  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.7.2 Reference modifications
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::add_pointer;
-  using std::tr1::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<add_pointer<int>::type, int*>::value) );
-  VERIFY( (is_same<add_pointer<int*>::type, int**>::value) );
-  VERIFY( (is_same<add_pointer<const int>::type, const int*>::value) );
-  VERIFY( (is_same<add_pointer<int&>::type, int*>::value) );
-  VERIFY( (is_same<add_pointer<ClassType*>::type, ClassType**>::value) );
-  VERIFY( (is_same<add_pointer<ClassType>::type, ClassType*>::value) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc
new file mode 100644 (file)
index 0000000..56f23a8
--- /dev/null
@@ -0,0 +1,46 @@
+// 2004-12-12  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.7.2 Reference modifications
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::add_pointer;
+  using std::tr1::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_pointer<int>::type, int*>::value) );
+  VERIFY( (is_same<add_pointer<int*>::type, int**>::value) );
+  VERIFY( (is_same<add_pointer<const int>::type, const int*>::value) );
+  VERIFY( (is_same<add_pointer<int&>::type, int*>::value) );
+  VERIFY( (is_same<add_pointer<ClassType*>::type, ClassType**>::value) );
+  VERIFY( (is_same<add_pointer<ClassType>::type, ClassType*>::value) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc
deleted file mode 100644 (file)
index 29ad8c3..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// 2004-12-08  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 2004, 2005, 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.7.2 Reference modifications
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::add_reference;
-  using std::tr1::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<add_reference<int>::type, int&>::value) );
-  VERIFY( (is_same<add_reference<int&>::type, int&>::value) );
-  VERIFY( (is_same<add_reference<const int>::type, const int&>::value) );
-  VERIFY( (is_same<add_reference<int*>::type, int*&>::value) );
-  VERIFY( (is_same<add_reference<ClassType&>::type, ClassType&>::value) );
-  VERIFY( (is_same<add_reference<ClassType>::type, ClassType&>::value) );
-
-  VERIFY( (is_same<add_reference<void>::type, void>::value) );
-  VERIFY( (is_same<add_reference<const void>::type, const void>::value) );  
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc
new file mode 100644 (file)
index 0000000..eab29f4
--- /dev/null
@@ -0,0 +1,49 @@
+// 2004-12-08  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.7.2 Reference modifications
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::add_reference;
+  using std::tr1::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_reference<int>::type, int&>::value) );
+  VERIFY( (is_same<add_reference<int&>::type, int&>::value) );
+  VERIFY( (is_same<add_reference<const int>::type, const int&>::value) );
+  VERIFY( (is_same<add_reference<int*>::type, int*&>::value) );
+  VERIFY( (is_same<add_reference<ClassType&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_reference<ClassType>::type, ClassType&>::value) );
+
+  VERIFY( (is_same<add_reference<void>::type, void>::value) );
+  VERIFY( (is_same<add_reference<const void>::type, const void>::value) );  
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc
deleted file mode 100644 (file)
index 489b059..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.7.1 Const-volatile modifications
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::add_volatile;
-  using std::tr1::is_same;
-  using namespace __gnu_test;
-
-  VERIFY( (is_same<add_volatile<int>::type, volatile int>::value) );
-  VERIFY( (is_same<add_volatile<const int>::type, const volatile int>::value) );
-  VERIFY( (is_same<add_volatile<int*>::type, int* volatile>::value) );
-  VERIFY( (is_same<add_volatile<int&>::type, int&>::value) );
-  VERIFY( (is_same<add_volatile<int (int)>::type, int (int)>::value) );
-  VERIFY( (is_same<add_volatile<volatile int>::type, volatile int>::value) );
-  VERIFY( (is_same<add_volatile<ClassType>::type, volatile ClassType>::value) );
-  VERIFY( (is_same<add_volatile<const ClassType>::type,
-          const volatile ClassType>::value) );
-  VERIFY( (is_same<add_volatile<ClassType*>::type,
-          ClassType* volatile>::value) );
-  VERIFY( (is_same<add_volatile<ClassType&>::type, ClassType&>::value) );
-  VERIFY( (is_same<add_volatile<ClassType (ClassType)>::type,
-          ClassType (ClassType)>::value) );
-  VERIFY( (is_same<add_volatile<volatile ClassType>::type,
-          volatile ClassType>::value) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc
new file mode 100644 (file)
index 0000000..4ac96a7
--- /dev/null
@@ -0,0 +1,56 @@
+// 2004-12-16  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.7.1 Const-volatile modifications
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::add_volatile;
+  using std::tr1::is_same;
+  using namespace __gnu_test;
+
+  VERIFY( (is_same<add_volatile<int>::type, volatile int>::value) );
+  VERIFY( (is_same<add_volatile<const int>::type, const volatile int>::value) );
+  VERIFY( (is_same<add_volatile<int*>::type, int* volatile>::value) );
+  VERIFY( (is_same<add_volatile<int&>::type, int&>::value) );
+  VERIFY( (is_same<add_volatile<int (int)>::type, int (int)>::value) );
+  VERIFY( (is_same<add_volatile<volatile int>::type, volatile int>::value) );
+  VERIFY( (is_same<add_volatile<ClassType>::type, volatile ClassType>::value) );
+  VERIFY( (is_same<add_volatile<const ClassType>::type,
+          const volatile ClassType>::value) );
+  VERIFY( (is_same<add_volatile<ClassType*>::type,
+          ClassType* volatile>::value) );
+  VERIFY( (is_same<add_volatile<ClassType&>::type, ClassType&>::value) );
+  VERIFY( (is_same<add_volatile<ClassType (ClassType)>::type,
+          ClassType (ClassType)>::value) );
+  VERIFY( (is_same<add_volatile<volatile ClassType>::type,
+          volatile ClassType>::value) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc
deleted file mode 100644 (file)
index bbc336c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-// 2005-01-11  Paolo Carlini  <pcarlini@suse.de>
-//
-// Copyright (C) 2005 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// 4.8 Other transformations
-
-#include <tr1/type_traits>
-#include <testsuite_hooks.h>
-#include <testsuite_tr1.h>
-
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::tr1::aligned_storage;
-  using std::tr1::alignment_of;
-  using namespace __gnu_test;
-  
-  const std::size_t align_c = alignment_of<char>::value;
-  VERIFY( (sizeof(aligned_storage<4, align_c>::type) >= 4) );
-  VERIFY( (__alignof__(aligned_storage<4, align_c>::type) == align_c) );
-
-  const std::size_t align_s = alignment_of<short>::value;
-  VERIFY( (sizeof(aligned_storage<1, align_s>::type) >= 1) );
-  VERIFY( (__alignof__(aligned_storage<1, align_s>::type) == align_s) );
-
-  const std::size_t align_i = alignment_of<int>::value;
-  VERIFY( (sizeof(aligned_storage<7, align_i>::type) >= 7) );
-  VERIFY( (__alignof__(aligned_storage<7, align_i>::type) == align_i) );
-
-  const std::size_t align_d = alignment_of<double>::value;
-  VERIFY( (sizeof(aligned_storage<2, align_d>::type) >= 2) );
-  VERIFY( (__alignof__(aligned_storage<2, align_d>::type) == align_d) );
-
-  const std::size_t align_ai = alignment_of<int[4]>::value;
-  VERIFY( (sizeof(aligned_storage<20, align_ai>::type) >= 20) );
-  VERIFY( (__alignof__(aligned_storage<20, align_ai>::type) == align_ai) );
-
-  const std::size_t align_ct = alignment_of<ClassType>::value;
-  VERIFY( (sizeof(aligned_storage<11, align_ct>::type) >= 11) );
-  VERIFY( (__alignof__(aligned_storage<11, align_ct>::type) == align_ct) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc
new file mode 100644 (file)
index 0000000..205c974
--- /dev/null
@@ -0,0 +1,63 @@
+// 2005-01-11  Paolo Carlini  <pcarlini@suse.de>
+//
+// Copyright (C) 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 4.8 Other transformations
+
+#include <tr1/type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+  bool test __attribute__((unused)) = true;
+  using std::tr1::aligned_storage;
+  using std::tr1::alignment_of;
+  using namespace __gnu_test;
+  
+  const std::size_t align_c = alignment_of<char>::value;
+  VERIFY( (sizeof(aligned_storage<4, align_c>::type) >= 4) );
+  VERIFY( (__alignof__(aligned_storage<4, align_c>::type) == align_c) );
+
+  const std::size_t align_s = alignment_of<short>::value;
+  VERIFY( (sizeof(aligned_storage<1, align_s>::type) >= 1) );
+  VERIFY( (__alignof__(aligned_storage<1, align_s>::type) == align_s) );
+
+  const std::size_t align_i = alignment_of<int>::value;
+  VERIFY( (sizeof(aligned_storage<7, align_i>::type) >= 7) );
+  VERIFY( (__alignof__(aligned_storage<7, align_i>::type) == align_i) );
+
+  const std::size_t align_d = alignment_of<double>::value;
+  VERIFY( (sizeof(aligned_storage<2, align_d>::type) >= 2) );
+  VERIFY( (__alignof__(aligned_storage<2, align_d>::type) == align_d) );
+
+  const std::size_t align_ai = alignment_of<int[4]>::value;
+  VERIFY( (sizeof(aligned_storage<20, align_ai>::type) >= 20) );
+  VERIFY( (__alignof__(aligned_storage<20, align_ai>::type) == align_ai) );
+
+  const std::size_t align_ct = alignment_of<ClassType>::value;
+  VERIFY( (sizeof(aligned_storage<11, align_ct>::type) >= 11) );
+  VERIFY( (__alignof__(aligned_storage<11, align_ct>::type) == align_ct) );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}