From: Jonathan Wakely Date: Thu, 8 Jan 2015 16:24:55 +0000 (+0000) Subject: re PR libstdc++/60132 (C++11: lack of is_trivially_copy_constructible) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c66b93fe2071248e4ef3cfc84449743d022c56dd;p=gcc.git re PR libstdc++/60132 (C++11: lack of is_trivially_copy_constructible) PR libstdc++/60132 * include/std/type_traits (has_trivial_default_constructor, has_trivial_copy_constructor, has_trivial_copy_assign): Add deprecated attribute. * testsuite/20_util/has_trivial_copy_assign/requirements/ explicit_instantiation.cc: Use -Wno-deprecated. * testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc: Likewise. * testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/requirements/ typedefs.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/requirements/ explicit_instantiation.c: Likewise. * testsuite/20_util/has_trivial_default_constructor/requirements/ typedefs.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/pair/requirements/dr801.cc: Replace deprecated trait. * testsuite/20_util/tuple/requirements/dr801.cc: Likewise. * testsuite/util/testsuite_common_types.h: Likewise. From-SVN: r219350 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7e261654903..85b08fa4bd9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,30 @@ +2015-01-08 Jonathan Wakely + + PR libstdc++/60132 + * include/std/type_traits (has_trivial_default_constructor, + has_trivial_copy_constructor, has_trivial_copy_assign): Add deprecated + attribute. + * testsuite/20_util/has_trivial_copy_assign/requirements/ + explicit_instantiation.cc: Use -Wno-deprecated. + * testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise. + * testsuite/20_util/has_trivial_copy_constructor/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/has_trivial_copy_constructor/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. + * testsuite/20_util/has_trivial_default_constructor/requirements/ + explicit_instantiation.c: Likewise. + * testsuite/20_util/has_trivial_default_constructor/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/has_trivial_default_constructor/value.cc: + Likewise. + * testsuite/20_util/pair/requirements/dr801.cc: Replace deprecated + trait. + * testsuite/20_util/tuple/requirements/dr801.cc: Likewise. + * testsuite/util/testsuite_common_types.h: Likewise. + 2015-01-08 Jonathan Wakely * include/bits/hashtable_policy.h: Use __bool_constant. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 4397c165e8d..03e198acd08 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -1382,19 +1382,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct has_trivial_default_constructor : public integral_constant - { }; + { } _GLIBCXX_DEPRECATED; /// has_trivial_copy_constructor (temporary legacy) template struct has_trivial_copy_constructor : public integral_constant - { }; + { } _GLIBCXX_DEPRECATED; /// has_trivial_copy_assign (temporary legacy) template struct has_trivial_copy_assign : public integral_constant - { }; + { } _GLIBCXX_DEPRECATED; /// has_virtual_destructor template diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/explicit_instantiation.cc index 19b4c9988e3..1b2c02b4caf 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/explicit_instantiation.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2010-06-08 Paolo Carlini diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc index 3044ec3849a..c5fd5ec5549 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // 2010-06-08 Paolo Carlini // // Copyright (C) 2010-2015 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc index 1cfafaa697d..bd778ad0759 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2010-06-08 Paolo Carlini diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/explicit_instantiation.cc index 0e28a4febc0..65178525b1c 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/explicit_instantiation.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2007-04-30 Benjamin Kosnik diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/typedefs.cc index 1df20b7e671..0eb1e39913c 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/requirements/typedefs.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // 2004-12-30 Paolo Carlini // // Copyright (C) 2004-2015 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc index 2848e42d36a..ea58a22f2f1 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2004-12-30 Paolo Carlini diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/explicit_instantiation.cc index 0bb4ab91f31..66d72d9b9eb 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/explicit_instantiation.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2007-04-30 Benjamin Kosnik diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/typedefs.cc index 806b66cebff..8eb7dc5cf9d 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/requirements/typedefs.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // 2004-12-26 Paolo Carlini // // Copyright (C) 2004-2015 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc index 669c7e0ab5a..71112744006 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc @@ -1,4 +1,4 @@ -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++11 -Wno-deprecated" } // { dg-do compile } // 2004-12-26 Paolo Carlini diff --git a/libstdc++-v3/testsuite/20_util/pair/requirements/dr801.cc b/libstdc++-v3/testsuite/20_util/pair/requirements/dr801.cc index f44774c6355..408ac5da519 100644 --- a/libstdc++-v3/testsuite/20_util/pair/requirements/dr801.cc +++ b/libstdc++-v3/testsuite/20_util/pair/requirements/dr801.cc @@ -27,7 +27,7 @@ void test_trivial() // PODType, TType, NType, SLType, LType, NLType, LTypeDerived typedef std::pair pair_type; // static_assert(std::is_literal_type::value, "! literal"); - static_assert(std::has_trivial_copy_constructor::value, + static_assert(std::is_trivially_copy_constructible::value, "! triv copy"); static_assert(std::is_trivially_destructible::value, "! triv destructor"); diff --git a/libstdc++-v3/testsuite/20_util/tuple/requirements/dr801.cc b/libstdc++-v3/testsuite/20_util/tuple/requirements/dr801.cc index d8992c1ba12..c9358eef5c9 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/requirements/dr801.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/requirements/dr801.cc @@ -27,7 +27,7 @@ void test_trivial() // PODType, TType, NType, SLType, LType, NLType, LTypeDerived typedef std::tuple tuple_type; // static_assert(std::is_literal_type::value, "! literal"); - static_assert(std::has_trivial_copy_constructor::value, + static_assert(std::is_trivially_copy_constructible::value, "! triv copy"); static_assert(std::is_trivially_destructible::value, "! triv destructor"); diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index bb3d99a0f77..a5491e2773a 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -545,7 +545,7 @@ namespace __gnu_test { void __constraint() { - typedef std::has_trivial_default_constructor<_Tp> ctor_p; + typedef std::is_trivially_default_constructible<_Tp> ctor_p; static_assert(ctor_p::value, "default constructor not trivial"); typedef std::is_trivially_destructible<_Tp> dtor_p;