diff mbox series

[5/6] libstdc++: port tests away from is_trivial

Message ID 8088e730-0639-4f78-917e-14a1272a73e8@kdab.com
State New
Headers show
Series [1/6] libstdc++: port away from is_trivial in string classes | expand

Commit Message

Giuseppe D'Angelo Dec. 9, 2024, 12:22 p.m. UTC
Hello,

This ports some misc test away from is_trivial.

Thanks,

Comments

Jonathan Wakely Dec. 9, 2024, 1:48 p.m. UTC | #1
On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
>Hello,
>
>This ports some misc test away from is_trivial.

This is fine, thanks.

>Thanks,
>-- 
>Giuseppe D'Angelo

>From 7b0548ee8732b5211a50cba7781b4fe25d9f5f04 Mon Sep 17 00:00:00 2001
>From: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
>Date: Mon, 9 Dec 2024 02:44:30 +0100
>Subject: [PATCH 5/6] libstdc++: port tests away from is_trivial
>
>In preparation for the deprecation of is_trivial (P3247R2).
>Mostly a mechanical exercise, replacing is_trivial with
>is_trivially_copyable and/or is_trivially_default_constructible
>depending on the cases.
>
>libstdc++-v3/ChangeLog:
>
>	* testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc: Port away from is_trivial.
>	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc: Likewise.
>	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc: Likewise.
>	* testsuite/23_containers/vector/cons/94540.cc: Likewise.
>	* testsuite/25_algorithms/copy/move_iterators/69478.cc: Likewise.
>	* testsuite/25_algorithms/copy_backward/move_iterators/69478.cc: Likewise.
>	* testsuite/25_algorithms/move/69478.cc: Likewise.
>	* testsuite/25_algorithms/move_backward/69478.cc: Likewise.
>	* testsuite/25_algorithms/rotate/constrained.cc: Likewise.
>	* testsuite/25_algorithms/rotate_copy/constrained.cc: Likewise.
>
>Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
>---
> .../specialized_algorithms/uninitialized_copy/102064.cc     | 6 ++++--
> .../specialized_algorithms/uninitialized_copy_n/102064.cc   | 6 ++++--
> .../specialized_algorithms/uninitialized_default/94540.cc   | 3 ++-
> .../specialized_algorithms/uninitialized_default_n/94540.cc | 3 ++-
> .../specialized_algorithms/uninitialized_fill/102064.cc     | 6 ++++--
> .../specialized_algorithms/uninitialized_fill_n/102064.cc   | 6 ++++--
> .../uninitialized_value_construct/94540.cc                  | 3 ++-
> .../uninitialized_value_construct_n/94540.cc                | 3 ++-
> libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc   | 3 ++-
> .../testsuite/25_algorithms/copy/move_iterators/69478.cc    | 3 ++-
> .../25_algorithms/copy_backward/move_iterators/69478.cc     | 3 ++-
> libstdc++-v3/testsuite/25_algorithms/move/69478.cc          | 3 ++-
> libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc | 3 ++-
> libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc  | 2 +-
> .../testsuite/25_algorithms/rotate_copy/constrained.cc      | 2 +-
> 15 files changed, 36 insertions(+), 19 deletions(-)
>
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
>index 27d37aab09f..83caaaec137 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
>@@ -19,7 +19,8 @@ private:
> Y::operator X() const { return X(); }
> 
> #if __cplusplus >= 201103L
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> #endif
> 
> void test01_pr102064()
>@@ -40,7 +41,8 @@ struct Z
>   Z& operator=(int) = delete;
> };
> 
>-static_assert( std::is_trivial<Z>::value, "" );
>+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
>+static_assert( std::is_trivially_copyable<Z>::value, "" );
> 
> void test02_pr102064()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
>index 963e1531a71..bb0850a34c1 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
>@@ -18,7 +18,8 @@ private:
> 
> Y::operator X() const { return X(); }
> 
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> 
> void test01_pr102064()
> {
>@@ -37,7 +38,8 @@ struct Z
>   Z& operator=(int) = delete;
> };
> 
>-static_assert( std::is_trivial<Z>::value, "" );
>+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
>+static_assert( std::is_trivially_copyable<Z>::value, "" );
> 
> void test02_pr102064()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
>index 609fd268948..20716cba987 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
>@@ -23,7 +23,8 @@
> // Assume that 9MB is larger than the stack limit.
> struct X { char data[9*1024*1024]; };
> 
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> 
> int main()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
>index fae3cf59587..2368aae5628 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
>@@ -23,7 +23,8 @@
> // Assume that 9MB is larger than the stack limit.
> struct X { char data[9*1024*1024]; };
> 
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> 
> int main()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
>index 7eb49b543a4..14827cf9325 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
>@@ -19,7 +19,8 @@ private:
> Y::operator X() const { return X(); }
> 
> #if __cplusplus >= 201103L
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> #endif
> 
> void test01_pr102064()
>@@ -40,7 +41,8 @@ struct Z
>   Z& operator=(int) = delete;
> };
> 
>-static_assert( std::is_trivial<Z>::value, "" );
>+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
>+static_assert( std::is_trivially_copyable<Z>::value, "" );
> 
> void test02_pr102064()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
>index e4f2139cf6d..3bac1ece67c 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
>@@ -19,7 +19,8 @@ private:
> Y::operator X() const { return X(); }
> 
> #if __cplusplus >= 201103L
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> #endif
> 
> void test01_pr102064()
>@@ -40,7 +41,8 @@ struct Z
>   Z& operator=(int) = delete;
> };
> 
>-static_assert( std::is_trivial<Z>::value, "" );
>+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
>+static_assert( std::is_trivially_copyable<Z>::value, "" );
> 
> void test02_pr102064()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
>index e891e81df93..4c5af9d8c7b 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
>@@ -23,7 +23,8 @@
> // Assume that 9MB is larger than the stack limit.
> struct X { char data[9*1024*1024]; };
> 
>-static_assert( std::is_trivial_v<X> );
>+static_assert( std::is_trivially_copyable_v<X> );
>+static_assert( std::is_trivially_default_constructible_v<X> );
> 
> int main()
> {
>diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
>index 1c4db602490..a1ee31c7413 100644
>--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
>+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
>@@ -23,7 +23,8 @@
> // Assume that 9MB is larger than the stack limit.
> struct X { char data[9*1024*1024]; };
> 
>-static_assert( std::is_trivial_v<X> );
>+static_assert( std::is_trivially_copyable_v<X> );
>+static_assert( std::is_trivially_default_constructible_v<X> );
> 
> int main()
> {
>diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
>index 603c1ec1d3e..1691a75434f 100644
>--- a/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
>+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
>@@ -23,7 +23,8 @@
> // Assume that 9MB is larger than the stack limit.
> struct X { char data[9*1024*1024]; };
> 
>-static_assert( std::is_trivial<X>::value, "" );
>+static_assert( std::is_trivially_default_constructible<X>::value, "" );
>+static_assert( std::is_trivially_copyable<X>::value, "" );
> 
> int main()
> {
>diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
>index 2d0ff728b8c..84ead4831a6 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
>@@ -32,7 +32,8 @@ test01()
>     trivial_rvalstruct(trivial_rvalstruct&&) = default;
>     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
>   };
>-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
> 
>   trivial_rvalstruct a[1], b[1];
>   copy(std::make_move_iterator(a), std::make_move_iterator(a + 1), b);
>diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
>index 572eaab8eff..dde85ad8545 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
>@@ -32,7 +32,8 @@ test01()
>     trivial_rvalstruct(trivial_rvalstruct&&) = default;
>     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
>   };
>-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
> 
>   trivial_rvalstruct a[1], b[1];
>   copy_backward(std::make_move_iterator(a), std::make_move_iterator(a+1), b+1);
>diff --git a/libstdc++-v3/testsuite/25_algorithms/move/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
>index 3cad8c8304a..04a369080b1 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
>@@ -32,7 +32,8 @@ test01()
>     trivial_rvalstruct(trivial_rvalstruct&&) = default;
>     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
>   };
>-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
> 
>   trivial_rvalstruct a[1], b[1];
>   std::move(a, a + 1, b);
>diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
>index 5892f0b38ab..9a88dae4d5e 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
>@@ -32,7 +32,8 @@ test01()
>     trivial_rvalstruct(trivial_rvalstruct&&) = default;
>     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
>   };
>-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
>+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
> 
>   trivial_rvalstruct a[1], b[1];
>   std::move_backward(a, a + 1, b + 1);
>diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
>index 33f2633dfdd..37a47e10b10 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
>@@ -41,7 +41,7 @@ struct X
>   }
> };
> 
>-static_assert(!std::is_trivial_v<X>);
>+static_assert(!std::is_trivially_default_constructible_v<X>);
> 
> template<template<typename, template<typename> typename> typename container,
> 	 template<typename> typename wrapper,
>diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
>index 2907e3bc5b3..85afbe3ea73 100644
>--- a/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
>+++ b/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
>@@ -41,7 +41,7 @@ struct X
>   }
> };
> 
>-static_assert(!std::is_trivial_v<X>);
>+static_assert(!std::is_trivially_default_constructible_v<X>);
> 
> template<template<typename, template<typename> typename> typename container,
> 	 template<typename> typename wrapper,
>-- 
>2.34.1
>
Jonathan Wakely Dec. 9, 2024, 5:43 p.m. UTC | #2
On Mon, 9 Dec 2024 at 13:49, Jonathan Wakely wrote:
>
> On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
> >Hello,
> >
> >This ports some misc test away from is_trivial.
>
> This is fine, thanks.

I'm seeing a number of FAILures not fixed by this patch:

FAIL: experimental/iterator/requirements.cc  -std=gnu++26 (test for
excess errors)
FAIL: experimental/memory/observer_ptr/typedefs.cc  -std=gnu++26 (test
for excess errors)
FAIL: experimental/memory/shared_ptr/observers/bool_conv.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/move_ctor.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/array/neg.cc  -std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/assign/assign.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/observers/operators.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/pointer_ctor.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cast/cast.cc  -std=gnu++26 (test
for excess errors)
FAIL: experimental/memory/shared_ptr/observers/owner_before.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/comparison/comparison.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/observers/use_count.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/observer_ptr/assignment/assign.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/torture.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/alias_ctor.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/observer_ptr/cons/cons.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/alloc_ctor.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/observer_ptr/hash/hash.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/weak_ptr_ctor.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/observer_ptr/make_observer.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/cons/copy_ctor.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/dest/dest.cc  -std=gnu++26 (test
for excess errors)
FAIL: experimental/memory/shared_ptr/cons/copy_ctor_neg.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/observer_ptr/relops/relops.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/memory/shared_ptr/modifiers/reset.cc  -std=gnu++26
(test for excess errors)
FAIL: experimental/iterator/make_ostream_joiner.cc  -std=gnu++26 (test
for excess errors)
FAIL: experimental/memory/shared_ptr/cons/default_ctor.cc
-std=gnu++26 (test for excess errors)
FAIL: experimental/memory/observer_ptr/requirements.cc  -std=gnu++26
(test for excess errors)

(and counting ...)
Jonathan Wakely Dec. 9, 2024, 5:44 p.m. UTC | #3
On Mon, 9 Dec 2024 at 17:43, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Mon, 9 Dec 2024 at 13:49, Jonathan Wakely wrote:
> >
> > On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
> > >Hello,
> > >
> > >This ports some misc test away from is_trivial.
> >
> > This is fine, thanks.
>
> I'm seeing a number of FAILures not fixed by this patch:
>
> FAIL: experimental/iterator/requirements.cc  -std=gnu++26 (test for
> excess errors)
> FAIL: experimental/memory/observer_ptr/typedefs.cc  -std=gnu++26 (test
> for excess errors)
> FAIL: experimental/memory/shared_ptr/observers/bool_conv.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/move_ctor.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/array/neg.cc  -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/assign/assign.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/observers/operators.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/pointer_ctor.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cast/cast.cc  -std=gnu++26 (test
> for excess errors)
> FAIL: experimental/memory/shared_ptr/observers/owner_before.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/comparison/comparison.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/observers/use_count.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/observer_ptr/assignment/assign.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/torture.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/alias_ctor.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/observer_ptr/cons/cons.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/alloc_ctor.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/observer_ptr/hash/hash.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/weak_ptr_ctor.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/observer_ptr/make_observer.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/copy_ctor.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/dest/dest.cc  -std=gnu++26 (test
> for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/copy_ctor_neg.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/observer_ptr/relops/relops.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/memory/shared_ptr/modifiers/reset.cc  -std=gnu++26
> (test for excess errors)
> FAIL: experimental/iterator/make_ostream_joiner.cc  -std=gnu++26 (test
> for excess errors)
> FAIL: experimental/memory/shared_ptr/cons/default_ctor.cc
> -std=gnu++26 (test for excess errors)
> FAIL: experimental/memory/observer_ptr/requirements.cc  -std=gnu++26
> (test for excess errors)
>
> (and counting ...)

I guess you need to test with:

GLIBCXX_TESTSUITE_STD=23 make check

to run everything with -std=gnu++26
Jonathan Wakely Dec. 9, 2024, 6:23 p.m. UTC | #4
On Mon, 9 Dec 2024 at 17:44, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Mon, 9 Dec 2024 at 17:43, Jonathan Wakely <jwakely@redhat.com> wrote:
> >
> > On Mon, 9 Dec 2024 at 13:49, Jonathan Wakely wrote:
> > >
> > > On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
> > > >Hello,
> > > >
> > > >This ports some misc test away from is_trivial.
> > >
> > > This is fine, thanks.
> >
> > I'm seeing a number of FAILures not fixed by this patch:
> >
> > FAIL: experimental/iterator/requirements.cc  -std=gnu++26 (test for
> > excess errors)
> > FAIL: experimental/memory/observer_ptr/typedefs.cc  -std=gnu++26 (test
> > for excess errors)
> > FAIL: experimental/memory/shared_ptr/observers/bool_conv.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/move_ctor.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/array/neg.cc  -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/assign/assign.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/observers/operators.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/pointer_ctor.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cast/cast.cc  -std=gnu++26 (test
> > for excess errors)
> > FAIL: experimental/memory/shared_ptr/observers/owner_before.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/comparison/comparison.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/observers/use_count.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/assignment/assign.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/torture.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/alias_ctor.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/cons/cons.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/alloc_ctor.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/hash/hash.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/weak_ptr_ctor.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/make_observer.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/copy_ctor.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/dest/dest.cc  -std=gnu++26 (test
> > for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/copy_ctor_neg.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/relops/relops.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/memory/shared_ptr/modifiers/reset.cc  -std=gnu++26
> > (test for excess errors)
> > FAIL: experimental/iterator/make_ostream_joiner.cc  -std=gnu++26 (test
> > for excess errors)
> > FAIL: experimental/memory/shared_ptr/cons/default_ctor.cc
> > -std=gnu++26 (test for excess errors)
> > FAIL: experimental/memory/observer_ptr/requirements.cc  -std=gnu++26
> > (test for excess errors)
> >
> > (and counting ...)
>
> I guess you need to test with:
>
> GLIBCXX_TESTSUITE_STD=23 make check
>
> to run everything with -std=gnu++26

And the fix is probably just:

--- a/libstdc++-v3/include/experimental/type_traits
+++ b/libstdc++-v3/include/experimental/type_traits
@@ -121,8 +121,11 @@ template <typename _Tp>
  constexpr bool is_const_v = is_const<_Tp>::value;
template <typename _Tp>
  constexpr bool is_volatile_v = is_volatile<_Tp>::value;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template <typename _Tp>
  constexpr bool is_trivial_v = is_trivial<_Tp>::value;
+#pragma GCC diagnostic pop
template <typename _Tp>
  constexpr bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value;
template <typename _Tp>

I'll check this ...
Giuseppe D'Angelo Dec. 9, 2024, 8:34 p.m. UTC | #5
On 09/12/2024 18:43, Jonathan Wakely wrote:
> On Mon, 9 Dec 2024 at 13:49, Jonathan Wakely wrote:
>> On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
>>> Hello,
>>>
>>> This ports some misc test away from is_trivial.
>> This is fine, thanks.
> I'm seeing a number of FAILures not fixed by this patch:

Apologies, looks like I didn't stage everything in the right patches. 
Here's a new 6/6 patch that also suppresses the warning in experimental/...

Thanks,
Jonathan Wakely Dec. 10, 2024, 12:51 a.m. UTC | #6
On Mon, 9 Dec 2024 at 20:34, Giuseppe D'Angelo
<giuseppe.dangelo@kdab.com> wrote:
>
> On 09/12/2024 18:43, Jonathan Wakely wrote:
> > On Mon, 9 Dec 2024 at 13:49, Jonathan Wakely wrote:
> >> On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote:
> >>> Hello,
> >>>
> >>> This ports some misc test away from is_trivial.
> >> This is fine, thanks.
> > I'm seeing a number of FAILures not fixed by this patch:
>
> Apologies, looks like I didn't stage everything in the right patches.
> Here's a new 6/6 patch that also suppresses the warning in experimental/...

Thanks, all pushed now.
diff mbox series

Patch

From 7b0548ee8732b5211a50cba7781b4fe25d9f5f04 Mon Sep 17 00:00:00 2001
From: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Date: Mon, 9 Dec 2024 02:44:30 +0100
Subject: [PATCH 5/6] libstdc++: port tests away from is_trivial

In preparation for the deprecation of is_trivial (P3247R2).
Mostly a mechanical exercise, replacing is_trivial with
is_trivially_copyable and/or is_trivially_default_constructible
depending on the cases.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc: Port away from is_trivial.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc: Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc: Likewise.
	* testsuite/23_containers/vector/cons/94540.cc: Likewise.
	* testsuite/25_algorithms/copy/move_iterators/69478.cc: Likewise.
	* testsuite/25_algorithms/copy_backward/move_iterators/69478.cc: Likewise.
	* testsuite/25_algorithms/move/69478.cc: Likewise.
	* testsuite/25_algorithms/move_backward/69478.cc: Likewise.
	* testsuite/25_algorithms/rotate/constrained.cc: Likewise.
	* testsuite/25_algorithms/rotate_copy/constrained.cc: Likewise.

Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
---
 .../specialized_algorithms/uninitialized_copy/102064.cc     | 6 ++++--
 .../specialized_algorithms/uninitialized_copy_n/102064.cc   | 6 ++++--
 .../specialized_algorithms/uninitialized_default/94540.cc   | 3 ++-
 .../specialized_algorithms/uninitialized_default_n/94540.cc | 3 ++-
 .../specialized_algorithms/uninitialized_fill/102064.cc     | 6 ++++--
 .../specialized_algorithms/uninitialized_fill_n/102064.cc   | 6 ++++--
 .../uninitialized_value_construct/94540.cc                  | 3 ++-
 .../uninitialized_value_construct_n/94540.cc                | 3 ++-
 libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc   | 3 ++-
 .../testsuite/25_algorithms/copy/move_iterators/69478.cc    | 3 ++-
 .../25_algorithms/copy_backward/move_iterators/69478.cc     | 3 ++-
 libstdc++-v3/testsuite/25_algorithms/move/69478.cc          | 3 ++-
 libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc | 3 ++-
 libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc  | 2 +-
 .../testsuite/25_algorithms/rotate_copy/constrained.cc      | 2 +-
 15 files changed, 36 insertions(+), 19 deletions(-)

diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
index 27d37aab09f..83caaaec137 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/102064.cc
@@ -19,7 +19,8 @@  private:
 Y::operator X() const { return X(); }
 
 #if __cplusplus >= 201103L
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 #endif
 
 void test01_pr102064()
@@ -40,7 +41,8 @@  struct Z
   Z& operator=(int) = delete;
 };
 
-static_assert( std::is_trivial<Z>::value, "" );
+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
+static_assert( std::is_trivially_copyable<Z>::value, "" );
 
 void test02_pr102064()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
index 963e1531a71..bb0850a34c1 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy_n/102064.cc
@@ -18,7 +18,8 @@  private:
 
 Y::operator X() const { return X(); }
 
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 
 void test01_pr102064()
 {
@@ -37,7 +38,8 @@  struct Z
   Z& operator=(int) = delete;
 };
 
-static_assert( std::is_trivial<Z>::value, "" );
+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
+static_assert( std::is_trivially_copyable<Z>::value, "" );
 
 void test02_pr102064()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
index 609fd268948..20716cba987 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default/94540.cc
@@ -23,7 +23,8 @@ 
 // Assume that 9MB is larger than the stack limit.
 struct X { char data[9*1024*1024]; };
 
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 
 int main()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
index fae3cf59587..2368aae5628 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_n/94540.cc
@@ -23,7 +23,8 @@ 
 // Assume that 9MB is larger than the stack limit.
 struct X { char data[9*1024*1024]; };
 
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 
 int main()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
index 7eb49b543a4..14827cf9325 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/102064.cc
@@ -19,7 +19,8 @@  private:
 Y::operator X() const { return X(); }
 
 #if __cplusplus >= 201103L
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 #endif
 
 void test01_pr102064()
@@ -40,7 +41,8 @@  struct Z
   Z& operator=(int) = delete;
 };
 
-static_assert( std::is_trivial<Z>::value, "" );
+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
+static_assert( std::is_trivially_copyable<Z>::value, "" );
 
 void test02_pr102064()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
index e4f2139cf6d..3bac1ece67c 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill_n/102064.cc
@@ -19,7 +19,8 @@  private:
 Y::operator X() const { return X(); }
 
 #if __cplusplus >= 201103L
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 #endif
 
 void test01_pr102064()
@@ -40,7 +41,8 @@  struct Z
   Z& operator=(int) = delete;
 };
 
-static_assert( std::is_trivial<Z>::value, "" );
+static_assert( std::is_trivially_default_constructible<Z>::value, "" );
+static_assert( std::is_trivially_copyable<Z>::value, "" );
 
 void test02_pr102064()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
index e891e81df93..4c5af9d8c7b 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/94540.cc
@@ -23,7 +23,8 @@ 
 // Assume that 9MB is larger than the stack limit.
 struct X { char data[9*1024*1024]; };
 
-static_assert( std::is_trivial_v<X> );
+static_assert( std::is_trivially_copyable_v<X> );
+static_assert( std::is_trivially_default_constructible_v<X> );
 
 int main()
 {
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
index 1c4db602490..a1ee31c7413 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct_n/94540.cc
@@ -23,7 +23,8 @@ 
 // Assume that 9MB is larger than the stack limit.
 struct X { char data[9*1024*1024]; };
 
-static_assert( std::is_trivial_v<X> );
+static_assert( std::is_trivially_copyable_v<X> );
+static_assert( std::is_trivially_default_constructible_v<X> );
 
 int main()
 {
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
index 603c1ec1d3e..1691a75434f 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/94540.cc
@@ -23,7 +23,8 @@ 
 // Assume that 9MB is larger than the stack limit.
 struct X { char data[9*1024*1024]; };
 
-static_assert( std::is_trivial<X>::value, "" );
+static_assert( std::is_trivially_default_constructible<X>::value, "" );
+static_assert( std::is_trivially_copyable<X>::value, "" );
 
 int main()
 {
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
index 2d0ff728b8c..84ead4831a6 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
@@ -32,7 +32,8 @@  test01()
     trivial_rvalstruct(trivial_rvalstruct&&) = default;
     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
   };
-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
 
   trivial_rvalstruct a[1], b[1];
   copy(std::make_move_iterator(a), std::make_move_iterator(a + 1), b);
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
index 572eaab8eff..dde85ad8545 100644
--- a/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
@@ -32,7 +32,8 @@  test01()
     trivial_rvalstruct(trivial_rvalstruct&&) = default;
     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
   };
-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
 
   trivial_rvalstruct a[1], b[1];
   copy_backward(std::make_move_iterator(a), std::make_move_iterator(a+1), b+1);
diff --git a/libstdc++-v3/testsuite/25_algorithms/move/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
index 3cad8c8304a..04a369080b1 100644
--- a/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
@@ -32,7 +32,8 @@  test01()
     trivial_rvalstruct(trivial_rvalstruct&&) = default;
     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
   };
-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
 
   trivial_rvalstruct a[1], b[1];
   std::move(a, a + 1, b);
diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
index 5892f0b38ab..9a88dae4d5e 100644
--- a/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
@@ -32,7 +32,8 @@  test01()
     trivial_rvalstruct(trivial_rvalstruct&&) = default;
     trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
   };
-  static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_default_constructible<trivial_rvalstruct>::value, "");
+  static_assert(std::is_trivially_copyable<trivial_rvalstruct>::value, "");
 
   trivial_rvalstruct a[1], b[1];
   std::move_backward(a, a + 1, b + 1);
diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
index 33f2633dfdd..37a47e10b10 100644
--- a/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/rotate/constrained.cc
@@ -41,7 +41,7 @@  struct X
   }
 };
 
-static_assert(!std::is_trivial_v<X>);
+static_assert(!std::is_trivially_default_constructible_v<X>);
 
 template<template<typename, template<typename> typename> typename container,
 	 template<typename> typename wrapper,
diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
index 2907e3bc5b3..85afbe3ea73 100644
--- a/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/rotate_copy/constrained.cc
@@ -41,7 +41,7 @@  struct X
   }
 };
 
-static_assert(!std::is_trivial_v<X>);
+static_assert(!std::is_trivially_default_constructible_v<X>);
 
 template<template<typename, template<typename> typename> typename container,
 	 template<typename> typename wrapper,
-- 
2.34.1