On Tue, 10 Dec 2024 at 09:56, Jonathan Wakely <jwakely....@gmail.com> wrote: > > On Mon, 9 Dec 2024 at 13:21, Jonathan Wakely <jwak...@redhat.com> wrote: > > > > On 09/12/24 13:22 +0100, Giuseppe D'Angelo wrote: > > >Hello, > > > > > >This aligns __is_bitwise_relocatable with its modern meaning, that is, > > >checking for trivial move construction and destruction. > > > > Looks good, thanks. > > > > >Thanks, > > >-- > > >Giuseppe D'Angelo > > > > >From 0666e993066818ab0940c61d8d9539e883848b29 Mon Sep 17 00:00:00 2001 > > >From: Giuseppe D'Angelo <giuseppe.dang...@kdab.com> > > >Date: Mon, 9 Dec 2024 02:11:19 +0100 > > >Subject: [PATCH 3/6] libstdc++: port bitwise relocatable away from > > >is_trivial > > >MIME-Version: 1.0 > > >Content-Type: text/plain; charset=UTF-8 > > >Content-Transfer-Encoding: 8bit > > > > > >In preparation for the deprecation of is_trivial (P3247R2). > > >"bitwise relocation" (or "trivial relocation" à la P1144/P2786) > > >doesn't need the full-fledged notion of triviality, just checking for a > > >trivial move constructor and a trivial destructor is sufficient. > > > > > >libstdc++-v3/ChangeLog: > > > > > > * include/bits/stl_uninitialized.h: Amended the > > > __is_bitwise_relocatable type trait. > > > > > >Signed-off-by: Giuseppe D'Angelo <giuseppe.dang...@kdab.com> > > >--- > > > libstdc++-v3/include/bits/stl_uninitialized.h | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > >diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h > > >b/libstdc++-v3/include/bits/stl_uninitialized.h > > >index 2190261134e..916288352d7 100644 > > >--- a/libstdc++-v3/include/bits/stl_uninitialized.h > > >+++ b/libstdc++-v3/include/bits/stl_uninitialized.h > > >@@ -1248,7 +1248,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > // Also known as is_trivially_relocatable. > > > template<typename _Tp, typename = void> > > > struct __is_bitwise_relocatable > > >- : is_trivial<_Tp> { }; > > >+ : __and_<is_trivially_move_constructible<_Tp>, > > >is_trivially_destructible<_Tp>> { }; > > We need this to depend on is_trivially_copyable too, so we can use memcpy.
In fact, maybe it should *only* care about is_trivially_copyable. We already know the type must be move constructible and destructible, or it wouldn't be usable in std::vector in the first place. I'm going to revert it to is_trivial with the -Wdeprecated diagnostics disabled. This isn't an appropriate change for stage 3. > > I'm testing a fix now to fix bootstrap. > > > > > > > > template <typename _InputIterator, typename _ForwardIterator, > > > typename _Allocator> > > >-- > > >2.34.1 > > > > > > > > >