diff options
Diffstat (limited to 'gcc-4.9/libstdc++-v3/testsuite/20_util')
29 files changed, 213 insertions, 25 deletions
diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc index 9d80c5a89..0cee459a4 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/explicit_instantiation.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/typedefs.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/typedefs.cc index 7f2b1b899..e47147191 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/typedefs.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/value.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/value.cc index 5ad741d8b..29b8719da 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/value.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/alignment_of/value.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc index a744d8326..ff6a15940 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc @@ -19,7 +19,7 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. -// { dg-error "static assertion failed" "" { target *-*-* } 2003 } +// { dg-error "static assertion failed" "" { target *-*-* } 2040 } #include <utility> diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/function/60594.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/function/60594.cc new file mode 100644 index 000000000..be80b3f44 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/function/60594.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2011-2014 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/>. + +// libstdc++/60594 + +#include <functional> +#include <type_traits> +struct bar; +using F = std::function<bar()>; +// check for copy constructible and assignable while 'bar' is incomplete +constexpr int c = std::is_copy_constructible<F>::value; +constexpr int a = std::is_copy_assignable<F>::value; +struct bar { }; +bar func(); +void test() +{ + F g{ &func }; + g = func; +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc index 5edbbd0a4..af5871fe8 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/explicit_instantiation.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc index b00698ba9..1e4bd3274 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/value.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/value.cc index 15c0eb2f8..7ab6a5d5b 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/value.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/has_virtual_destructor/value.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/explicit_instantiation.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/explicit_instantiation.cc index 43639b8c5..1ae681fe4 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/explicit_instantiation.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/explicit_instantiation.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/typedefs.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/typedefs.cc index bb847d325..b9fcb85bf 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/typedefs.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/value.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/value.cc index c056a8e7c..a8e336d37 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/value.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_array/value.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/explicit_instantiation.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/explicit_instantiation.cc index 6c7eb7d24..f467bc263 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/explicit_instantiation.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/explicit_instantiation.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/typedefs.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/typedefs.cc index 93f3ecb31..6c1866665 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/typedefs.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/value.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/value.cc index ccd187a7c..c418f7640 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/value.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_enum/value.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/explicit_instantiation.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/explicit_instantiation.cc index 3ae51e5fc..1786bf7bc 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/explicit_instantiation.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/explicit_instantiation.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/typedefs.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/typedefs.cc index f12acab81..3b574c4f2 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/typedefs.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/value.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/value.cc index 2c6d8c002..b8a3835e5 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/value.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/is_union/value.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++11" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc index e3b84d649..5b094d9a4 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc @@ -29,6 +29,7 @@ void test01() using std::make_signed; using std::is_same; using std::is_signed; + using std::is_volatile; // Positive tests. typedef make_signed<const int>::type test2_type; @@ -53,7 +54,9 @@ void test01() #ifdef _GLIBCXX_USE_WCHAR_T typedef make_signed<volatile wchar_t>::type test23_type; - static_assert( is_same<test23_type, volatile signed wchar_t>::value, + static_assert( is_signed<test23_type>::value + && is_volatile<test23_type>::value + && sizeof(test23_type) == sizeof(volatile wchar_t), "make_signed<volatile wchar_t>" ); #endif diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc index 654b3759c..3f47dba5b 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc @@ -30,6 +30,8 @@ void test01() { using std::make_signed; using std::is_same; + using std::is_signed; + using std::is_volatile; // Positive tests. typedef make_signed<const int>::type test2_type; @@ -50,7 +52,9 @@ void test01() #ifdef _GLIBCXX_USE_WCHAR_T typedef make_signed<volatile wchar_t>::type test23_type; - static_assert(is_same<test23_type, volatile signed wchar_t>::value, ""); + static_assert(is_signed<test23_type>::value + && is_volatile<test23_type>::value + && sizeof(test23_type) == sizeof(volatile wchar_t), ""); #endif typedef make_signed<test_enum>::type test24_type; diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-3.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-3.cc index 16c7c90c5..f76900403 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-3.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-3.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++1y" } // { dg-do compile } -// Copyright (C) 2013-2014 Free Software Foundation, Inc. +// Copyright (C) 2013 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/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc new file mode 100644 index 000000000..4950e5470 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc @@ -0,0 +1,33 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } +// { dg-require-cstdint "" } + +// Copyright (C) 2014 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> + +// libstdc++/60326 + +using namespace std; +#ifdef _GLIBCXX_USE_WCHAR_T +using wchar_signed = make_signed<wchar_t>::type; +using wchar_unsigned = make_unsigned<wchar_t>::type; +static_assert( !is_same<wchar_signed, wchar_unsigned>::value, "wchar_t" ); +#endif +static_assert( is_signed<make_signed<char16_t>::type>::value, "char16_t"); +static_assert( is_signed<make_signed<char32_t>::type>::value, "char32_t"); diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index 9f155ea92..d71154605 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "required from here" "" { target *-*-* } 40 } // { dg-error "required from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1714 } -// { dg-error "declaration of" "" { target *-*-* } 1678 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1747 } +// { dg-error "declaration of" "" { target *-*-* } 1711 } diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc index f07cf4a62..de655048f 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc @@ -29,6 +29,7 @@ void test01() using std::make_unsigned; using std::is_same; using std::is_unsigned; + using std::is_volatile; // Positive tests. typedef make_unsigned<const unsigned int>::type test2_type; @@ -49,7 +50,9 @@ void test01() #ifdef _GLIBCXX_USE_WCHAR_T typedef make_unsigned<volatile wchar_t>::type test23_type; - static_assert(is_same<test23_type, volatile wchar_t>::value, ""); + static_assert(is_unsigned<test23_type>::value + && is_volatile<test23_type>::value + && sizeof(test23_type) == sizeof(volatile wchar_t), ""); #endif // Chapter 48, chapter 20. Smallest rank such that new unsigned type diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc index 8997fb7d8..7801dca94 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc @@ -30,6 +30,8 @@ void test01() { using std::make_unsigned; using std::is_same; + using std::is_unsigned; + using std::is_volatile; // Positive tests. typedef make_unsigned<const unsigned int>::type test2_type; @@ -50,7 +52,9 @@ void test01() #ifdef _GLIBCXX_USE_WCHAR_T typedef make_unsigned<volatile wchar_t>::type test23_type; - static_assert(is_same<test23_type, volatile wchar_t>::value, ""); + static_assert(is_unsigned<test23_type>::value + && is_volatile<test23_type>::value + && sizeof(test23_type) == sizeof(volatile wchar_t), ""); #endif typedef make_unsigned<test_enum>::type test24_type; diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index 57a5c6167..c77205be0 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "required from here" "" { target *-*-* } 40 } // { dg-error "required from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1632 } -// { dg-error "declaration of" "" { target *-*-* } 1596 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1650 } +// { dg-error "declaration of" "" { target *-*-* } 1614 } diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/shared_ptr/cons/61036.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/shared_ptr/cons/61036.cc new file mode 100644 index 000000000..9cade6648 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/shared_ptr/cons/61036.cc @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2014 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/>. + +// 20.8.2.2 Template class shared_ptr [util.smartptr.shared] + +#include <memory> + +void test01() +{ + std::shared_ptr<void> p(new int); +} diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/60497.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/60497.cc new file mode 100644 index 000000000..76d422316 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/60497.cc @@ -0,0 +1,37 @@ +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2014 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/>. + +// libstdc++/60497 + +#include <tuple> + +struct A; +template<typename T> struct B { T t; }; + +using element_type = B<A>*; +using tuple_type = std::tuple<element_type>; + +tuple_type t; +const tuple_type ct; + +auto a = std::get<0>(t); +auto b = std::get<0>(ct); +auto c = std::get<element_type>(t); +auto d = std::get<element_type>(ct); diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/element_access/get_by_type.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/element_access/get_by_type.cc index 226e9e4a8..042f2149a 100644 --- a/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/element_access/get_by_type.cc +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/element_access/get_by_type.cc @@ -41,4 +41,8 @@ main() get<1>(b)=5; VERIFY(get<int>(b)==1 && get<int&>(b)==5 && get<const int&>(b)==2); VERIFY(j==5); + // test rvalue overload: + VERIFY(get<int>(std::move(b))==1); + VERIFY(get<int&>(std::move(b))==5); + VERIFY(get<const int&>(std::move(b))==2); } diff --git a/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/tuple_element_t.cc b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/tuple_element_t.cc new file mode 100644 index 000000000..e46af5c30 --- /dev/null +++ b/gcc-4.9/libstdc++-v3/testsuite/20_util/tuple/tuple_element_t.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++14" } +// { dg-do compile } + +// Copyright (C) 2014 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 <tuple> + +using namespace std; + +struct foo +{ }; + +int +main() +{ + // As foo isn't constructible from anything else, this + // lets us check if the alias is returning foo when it should + foo q1; + tuple_element_t<0,tuple<foo,void,int> > q2(q1); + tuple_element_t<2,tuple<void,int,foo> > q3(q1); +} |