[gdb/build, c++20] Stop using deprecated is_pod

When building gdb with clang 15 and -std=c++20, I run into:
...
gdbsupport/poison.h:52:11: error: 'is_pod<timeval>' is deprecated: use \
  is_standard_layout && is_trivial instead [-Werror,-Wdeprecated-declarations]
            std::is_pod<T>>
                 ^
...

Fix this by following the suggestion.

Likewise in gdb/unittests/ptid-selftests.c.

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries 2023-08-17 10:41:34 +02:00
parent 24a601dd70
commit 84c9951ebd
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,9 @@ namespace ptid {
This is a requirement for as long as we have ptids embedded in
structures allocated with malloc. */
static_assert (std::is_pod<ptid_t>::value, "ptid_t is POD");
static_assert (gdb::And<std::is_standard_layout<ptid_t>,
std::is_trivial<ptid_t>>::value,
"ptid_t is POD");
/* We want to avoid implicit conversion from int to ptid_t. */

View File

@ -49,7 +49,7 @@ be a compile-time error. */
template<typename T>
struct IsMemsettable
: gdb::Or<std::is_void<T>,
std::is_pod<T>>
gdb::And<std::is_standard_layout<T>, std::is_trivial<T>>>
{};
template <typename T,