mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 15:01:31 +08:00
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
This commit is contained in:
parent
1a6c5064f9
commit
caa39b2e84
libstdc++-v3
@ -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.
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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, "");
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
//
|
||||
|
@ -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>
|
||||
//
|
||||
|
@ -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.
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user