aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2007-06-02 17:24:09 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-06-02 17:24:09 +0000
commit4a27a739a266b3312bc85742fd98634e492d3c14 (patch)
tree6eba88ad4b4f7e007627f9108eb5ae1d828057a9 /libstdc++-v3/testsuite
parent4620d81e72dcc7e019f4b3c4f99cbf5b68869c5e (diff)
downloadgcc-4a27a739a266b3312bc85742fd98634e492d3c14.zip
gcc-4a27a739a266b3312bc85742fd98634e492d3c14.tar.gz
gcc-4a27a739a266b3312bc85742fd98634e492d3c14.tar.bz2
type_traits (is_reference, [...]): Remove.
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
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/20_util/add_lvalue_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc50
-rw-r--r--libstdc++-v3/testsuite/20_util/add_rvalue_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc48
-rw-r--r--libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/typedefs.cc37
-rw-r--r--libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc45
-rw-r--r--libstdc++-v3/testsuite/20_util/is_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/is_reference/requirements/typedefs.cc37
-rw-r--r--libstdc++-v3/testsuite/20_util/is_reference/value.cc47
-rw-r--r--libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/typedefs.cc37
-rw-r--r--libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc45
-rw-r--r--libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/20_util/remove_reference/requirements/explicit_instantiation.cc40
-rw-r--r--libstdc++-v3/testsuite/20_util/remove_reference/value.cc53
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/typedefs.cc)2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc)2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc)2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc)2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc)2
-rw-r--r--libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc (renamed from libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc)2
23 files changed, 649 insertions, 10 deletions
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
index 0000000..3eefabc
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..b4f4be4
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc
@@ -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
index 0000000..6dd1f9b
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..2709915
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc
@@ -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
index 0000000..a2c928e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..7315244
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/requirements/typedefs.cc
@@ -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
index 0000000..a80e606
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc
@@ -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
index 0000000..4cf4570
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..5ad8587
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_reference/requirements/typedefs.cc
@@ -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
index 0000000..af425c1
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_reference/value.cc
@@ -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
index 0000000..f4f45bf
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..5e3d68c
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/requirements/typedefs.cc
@@ -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
index 0000000..55f76d6
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc
@@ -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;
+}
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index 044f979..db34e04 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -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" }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index f12d941..e64c0e2 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -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
index 0000000..cbe29c5
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/remove_reference/requirements/explicit_instantiation.cc
@@ -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
index 0000000..00e2574
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/remove_reference/value.cc
@@ -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/value.cc
index 8669098..2b0c132 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc
@@ -1,6 +1,6 @@
// 2004-12-16 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc
index c197501..2fa2c2a 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc
@@ -1,6 +1,6 @@
// 2004-12-16 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc
index d87cd2e..56f23a8 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc
@@ -1,6 +1,6 @@
// 2004-12-12 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc
index 29ad8c3..eab29f4 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc
@@ -1,6 +1,6 @@
// 2004-12-08 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+// 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
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc
index 489b059..4ac96a7 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc
@@ -1,6 +1,6 @@
// 2004-12-16 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// 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
diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc
index bbc336c..205c974 100644
--- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc
@@ -1,6 +1,6 @@
// 2005-01-11 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2005 Free Software Foundation, Inc.
+// 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