https://gcc.gnu.org/g:5f14b91fbebfa880a4001aff153ed78f26f366a7

commit r13-9489-g5f14b91fbebfa880a4001aff153ed78f26f366a7
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Apr 2 12:52:54 2025 +0100

    libstdc++: Do not use compiler built-in in requires-clause
    
    This is a partial backport of r14-6064-gc3f281a0c1ca50 which replaced a
    use of __is_trivially_copyable in the requires-clause for std::bit_cast.
    The change isn't actually necessary on the gcc-13 and gcc-12 branches,
    but in gcc-14 using the built-in directly because ill-formed because we
    started to mangle requires-clauses.
    
    Replacing the built-in with the equivalent library trait makes it easier
    to do bisections with preprocessed source created by GCC 13, because the
    built-in won't cause errors with gcc-14 and later.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/bit (bit_cast): Use library trait instead of
            __is_trivially_copyable built-in.

Diff:
---
 libstdc++-v3/include/std/bit | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit
index 5eb40218be9d..03a2938b493b 100644
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -81,7 +81,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     bit_cast(const _From& __from) noexcept
 #ifdef __cpp_concepts
     requires (sizeof(_To) == sizeof(_From))
-      && __is_trivially_copyable(_To) && __is_trivially_copyable(_From)
+      && is_trivially_copyable_v<_To> && is_trivially_copyable_v<_From>
 #endif
     {
       return __builtin_bit_cast(_To, __from);

Reply via email to