diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-01-09 21:31:50 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2020-01-09 21:31:50 +0000 |
commit | caa39b2e842b03226551231688ef7190cbe44f89 (patch) | |
tree | e09cfd08d9178aacba3f5861bba00cdfdcb1445c | |
parent | 1a6c5064f920adec998932f66955c74fbfd1fa09 (diff) | |
download | gcc-caa39b2e842b03226551231688ef7190cbe44f89.zip gcc-caa39b2e842b03226551231688ef7190cbe44f89.tar.gz gcc-caa39b2e842b03226551231688ef7190cbe44f89.tar.bz2 |
libstdc++: Fix testsuite failures and warnings due to is_pod deprecation
With -std=gnu++2a and -Wsystem-headers the std::is_pod deprecation
causes some new diagnostics. This suppresses them.
* include/experimental/type_traits (experimental::is_pod_v): Disable
-Wdeprecated-declarations warnings around reference to std::is_pod.
* include/std/type_traits (is_pod_v): Likewise.
* testsuite/18_support/max_align_t/requirements/2.cc: Also check
is_standard_layout and is_trivial. Do not check is_pod for C++20.
* testsuite/20_util/is_pod/requirements/explicit_instantiation.cc:
Add -Wno-deprecated for C++20.
* testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_pod/value.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Likewise.
From-SVN: r280066
8 files changed, 27 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5725771..721b465 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2020-01-09 Jonathan Wakely <jwakely@redhat.com> + + * include/experimental/type_traits (experimental::is_pod_v): Disable + -Wdeprecated-declarations warnings around reference to std::is_pod. + * include/std/type_traits (is_pod_v): Likewise. + * testsuite/18_support/max_align_t/requirements/2.cc: Also check + is_standard_layout and is_trivial. Do not check is_pod for C++20. + * testsuite/20_util/is_pod/requirements/explicit_instantiation.cc: + Add -Wno-deprecated for C++20. + * testsuite/20_util/is_pod/requirements/typedefs.cc: Likewise. + * testsuite/20_util/is_pod/value.cc: Likewise. + * testsuite/experimental/type_traits/value.cc: Likewise. + 2020-01-09 JeanHeyd "ThePhD" Meneide <phdofthehouse@gmail.com> * include/bits/c++config (_GLIBCXX20_DEPRECATED): Add new macro. diff --git a/libstdc++-v3/include/experimental/type_traits b/libstdc++-v3/include/experimental/type_traits index a84ddd4..a92c385 100644 --- a/libstdc++-v3/include/experimental/type_traits +++ b/libstdc++-v3/include/experimental/type_traits @@ -110,8 +110,11 @@ template <typename _Tp> constexpr bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value; template <typename _Tp> constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" template <typename _Tp> constexpr bool is_pod_v = is_pod<_Tp>::value; +#pragma GCC diagnostic pop template <typename _Tp> constexpr bool is_literal_type_v = is_literal_type<_Tp>::value; template <typename _Tp> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index c69867c..6aa2ced 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3079,9 +3079,12 @@ template <typename _Tp> is_trivially_copyable<_Tp>::value; template <typename _Tp> inline constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" template <typename _Tp> _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead") inline constexpr bool is_pod_v = is_pod<_Tp>::value; +#pragma GCC diagnostic pop template <typename _Tp> inline constexpr bool is_literal_type_v = is_literal_type<_Tp>::value; template <typename _Tp> diff --git a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc index 97036ed..7e49696 100644 --- a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc +++ b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc @@ -20,4 +20,8 @@ #include <cstddef> #include <type_traits> +#if __cplusplus <= 201703L static_assert (std::is_pod<std::max_align_t>::value, ""); +#endif +static_assert (std::is_standard_layout<std::max_align_t>::value, ""); +static_assert (std::is_trivial<std::max_align_t>::value, ""); 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 index 7ee41b3..b41a593 100644 --- a/libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/is_pod/requirements/explicit_instantiation.cc @@ -1,4 +1,5 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-deprecated" { target { c++2a } } } // 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com> // Copyright (C) 2010-2020 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc index 492f0ea..8888957 100644 --- a/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/is_pod/requirements/typedefs.cc @@ -1,4 +1,5 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-deprecated" { target { c++2a } } } // 2010-02-21 Paolo Carlini <paolo.carlini@oracle.com> // diff --git a/libstdc++-v3/testsuite/20_util/is_pod/value.cc b/libstdc++-v3/testsuite/20_util/is_pod/value.cc index 5a85630..659d9d4 100644 --- a/libstdc++-v3/testsuite/20_util/is_pod/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_pod/value.cc @@ -1,4 +1,5 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-Wno-deprecated" { target { c++2a } } } // 2010-02-21 Paolo Carlini <pcarlini@suse.de> // diff --git a/libstdc++-v3/testsuite/experimental/type_traits/value.cc b/libstdc++-v3/testsuite/experimental/type_traits/value.cc index 156753b..0e1176d 100644 --- a/libstdc++-v3/testsuite/experimental/type_traits/value.cc +++ b/libstdc++-v3/testsuite/experimental/type_traits/value.cc @@ -1,4 +1,5 @@ // { dg-do compile { target c++14 } } +// { dg-additional-options "-Wno-deprecated" { target { c++2a } } } // Copyright (C) 2014-2020 Free Software Foundation, Inc. // |