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

commit r16-2723-g5ecbe70d0f34ac9dadefc21c809fb6a2369d1bad
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Sun Aug 3 17:13:37 2025 +0200

    libstdc++: Export std::owner_equal and std::owner_hash from std.cc
    
    I've tried compiling
      #include <bits/stdc++.h>
    with -std=c++26 -fdump-lang-all
    and
    for i in `grep ^Class.std::[^_] *.C.001l.class | sed 's/^Class //;s/[< 
].*$//' | sort -u | grep -v ::.*::`; do grep -q $i 
/usr/src/gcc/libstdc++-v3/src/c++23/std.cc.in || echo $i;
    +done
    This printed
    std::auto_ptr
    std::binary_function
    std::owner_equal
    std::owner_hash
    std::unary_function
    where auto_ptr, binary_function and unary_function have been removed in 
earlier
    versions of C++ and owner_equal and owner_hash are missing.
    
    The following patch adds them.
    
    Wonder how to automatically discover other missing exports (like in PR121373
    std::byteswap), maybe one could dig that stuff somehow from the raw
    dump (look for identifiers in std namespace (and perhaps inlined namespaces
    thereof at least) which don't start with underscore.
    
    2025-08-03  Jakub Jelinek  <ja...@redhat.com>
    
            * src/c++23/std.cc.in (std::owner_equal, std::owner_hash): Export.

Diff:
---
 libstdc++-v3/src/c++23/std.cc.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in
index 9301ed90c00f..ec048f6f4f3a 100644
--- a/libstdc++-v3/src/c++23/std.cc.in
+++ b/libstdc++-v3/src/c++23/std.cc.in
@@ -1982,6 +1982,10 @@ export namespace std
   using std::polymorphic;
   namespace pmr { using std::pmr::polymorphic; }
 #endif
+#if __cpp_lib_smart_ptr_owner_equality
+  using std::owner_equal;
+  using std::owner_hash;
+#endif
 }
 
 // 20.4 <memory_resource>

Reply via email to