https://gcc.gnu.org/g:4b9e1db1a14dbfc0b9a3cf9321fda4c041553b3a

commit r15-6073-g4b9e1db1a14dbfc0b9a3cf9321fda4c041553b3a
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Dec 10 09:48:57 2024 +0000

    libstdc++: Revert change to __bitwise_relocatable
    
    This reverts r15-6060-ge4a0157c2397c9 so that __is_bitwise_relocatable
    depends only on is_trivial. To avoid the deprecation warnings for C++26,
    use the __is_trivial built-in directly instead of std::is_trivial.
    
    We need to be sure that the type is trivially copyable, not just
    trivially constructible and trivially assignable. Otherwise we get
    -Wclass-memaccess diagnostics for e.g. std::vector<std::pair<A*, B*>>.
    We could add is_trivially_copyable to the conditions, but this isn't
    really an appropriate change for stage 3 anyway (it affects all modes
    from C++11 upwards). Just revert to using is_trivial, and we can revisit
    the condition for GCC 16.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/stl_uninitialized.h (__is_bitwise_relocatable):
            Revert to depending on is_trivial.

Diff:
---
 libstdc++-v3/include/bits/stl_uninitialized.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h 
b/libstdc++-v3/include/bits/stl_uninitialized.h
index 916288352d70..b7e65eb3ca06 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -1248,7 +1248,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Also known as is_trivially_relocatable.
   template<typename _Tp, typename = void>
     struct __is_bitwise_relocatable
-    : __and_<is_trivially_move_constructible<_Tp>, 
is_trivially_destructible<_Tp>> { };
+    : __bool_constant<__is_trivial(_Tp)>
+    { };
 
   template <typename _InputIterator, typename _ForwardIterator,
            typename _Allocator>

Reply via email to