aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2010-02-21 11:06:42 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2010-02-21 11:06:42 +0000
commitc76dc9b0e660bb78b5addda708a1b1eeb53ec1b8 (patch)
tree1250502d948c2bc58e52b6d4fc9dfa411d9ad319
parent878ee0ab0f556ba94f653d1352717d398e16a4ec (diff)
downloadgcc-c76dc9b0e660bb78b5addda708a1b1eeb53ec1b8.zip
gcc-c76dc9b0e660bb78b5addda708a1b1eeb53ec1b8.tar.gz
gcc-c76dc9b0e660bb78b5addda708a1b1eeb53ec1b8.tar.bz2
typedefs.cc: New.
2010-02-21 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/20_util/is_trivial/requirements/typedefs.cc: New. * testsuite/20_util/is_trivial/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_pod/value.cc: Likewise. * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_pod/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_standard_layout/requiremenents/ typedefs.cc: Likewise. * testsuite/20_util/is_standard_layout/requiremenents/ explicit_instantiation.cc: Likewise. From-SVN: r156934
-rw-r--r--libstdc++-v3/ChangeLog14
-rw-r--r--libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc30
-rw-r--r--libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc36
-rw-r--r--libstdc++-v3/testsuite/20_util/is_pod/value.cc54
-rw-r--r--libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/explicit_instantiation.cc30
-rw-r--r--libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/typedefs.cc36
-rw-r--r--libstdc++-v3/testsuite/20_util/is_trivial/requirements/explicit_instantiation.cc30
-rw-r--r--libstdc++-v3/testsuite/20_util/is_trivial/requirements/typedefs.cc36
8 files changed, 266 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index cf7aa9e..a9ccd8a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/20_util/is_trivial/requirements/typedefs.cc: New.
+ * testsuite/20_util/is_trivial/requirements/
+ explicit_instantiation.cc: Likewise.
+ * testsuite/20_util/is_pod/value.cc: Likewise.
+ * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
+ * testsuite/20_util/is_pod/requirements/
+ explicit_instantiation.cc: Likewise.
+ * testsuite/20_util/is_standard_layout/requiremenents/
+ typedefs.cc: Likewise.
+ * testsuite/20_util/is_standard_layout/requiremenents/
+ explicit_instantiation.cc: Likewise.
+
2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/35669
diff --git a/libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc
new file mode 100644
index 0000000..241cff7
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+ typedef short test_type;
+ template struct is_pod<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc
new file mode 100644
index 0000000..9c02b99
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+//
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::is_pod<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_pod/value.cc b/libstdc++-v3/testsuite/20_util/is_pod/value.cc
new file mode 100644
index 0000000..055a41c
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_pod/value.cc
@@ -0,0 +1,54 @@
+// { dg-options "-std=gnu++0x" }
+// 2010-02-21 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <type_traits>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using std::is_pod;
+ using namespace __gnu_test;
+
+ VERIFY( (test_category<is_pod, int>(true)) );
+ VERIFY( (test_category<is_pod, float>(true)) );
+ VERIFY( (test_category<is_pod, EnumType>(true)) );
+ VERIFY( (test_category<is_pod, int*>(true)) );
+ VERIFY( (test_category<is_pod, int(*)(int)>(true)) );
+ VERIFY( (test_category<is_pod, int (ClassType::*)>(true)) );
+ VERIFY( (test_category<is_pod, int (ClassType::*) (int)>(true)) );
+ VERIFY( (test_category<is_pod, int[2]>(true)) );
+ VERIFY( (test_category<is_pod, float[][3]>(true)) );
+ VERIFY( (test_category<is_pod, EnumType[2][3][4]>(true)) );
+ VERIFY( (test_category<is_pod, int*[3]>(true)) );
+ VERIFY( (test_category<is_pod, int(*[][2])(int)>(true)) );
+ VERIFY( (test_category<is_pod, int (ClassType::*[2][3])>(true)) );
+ VERIFY( (test_category<is_pod, int (ClassType::*[][2][3]) (int)>(true)) );
+ VERIFY( (test_category<is_pod, ClassType>(true)) );
+
+ VERIFY( (test_category<is_pod, void>(false)) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/explicit_instantiation.cc
new file mode 100644
index 0000000..619dc3e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/explicit_instantiation.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+ typedef short test_type;
+ template struct is_standard_layout<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/typedefs.cc
new file mode 100644
index 0000000..e209101
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_standard_layout/requiremenents/typedefs.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+//
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::is_standard_layout<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_trivial/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_trivial/requirements/explicit_instantiation.cc
new file mode 100644
index 0000000..043d122
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_trivial/requirements/explicit_instantiation.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+namespace std
+{
+ typedef short test_type;
+ template struct is_trivial<test_type>;
+}
diff --git a/libstdc++-v3/testsuite/20_util/is_trivial/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_trivial/requirements/typedefs.cc
new file mode 100644
index 0000000..4b8047f
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/is_trivial/requirements/typedefs.cc
@@ -0,0 +1,36 @@
+// { dg-options "-std=gnu++0x" }
+// 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+//
+// NB: This file is for testing type_traits with NO OTHER INCLUDES.
+
+#include <type_traits>
+
+// { dg-do compile }
+
+void test01()
+{
+ // Check for required typedefs
+ typedef std::is_trivial<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;
+}