https://gcc.gnu.org/g:ff3343518ae6e1aa1efe7fe02a6a4c6cb24f3b62

commit r15-8486-gff3343518ae6e1aa1efe7fe02a6a4c6cb24f3b62
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Mar 20 18:47:33 2025 +0000

    libstdc++: Fix std.compat exports of <stdbit.h> and <stdckdint.h>
    
    libstdc++-v3/ChangeLog:
    
            * src/c++23/std.compat.cc.in: Only export <stdbit.h> and
            <stdckdint.h> contents for C++26 and later.
    
    Reviewed-by: Tomasz KamiƄski <tkami...@redhat.com>

Diff:
---
 libstdc++-v3/src/c++23/std.compat.cc.in | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/src/c++23/std.compat.cc.in 
b/libstdc++-v3/src/c++23/std.compat.cc.in
index ba7ed0312ab8..344502195b1c 100644
--- a/libstdc++-v3/src/c++23/std.compat.cc.in
+++ b/libstdc++-v3/src/c++23/std.compat.cc.in
@@ -21,11 +21,15 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-export module std.compat;
-export import std;
+module;
 
 #include <stdbit.h>
+#include <stdckdint.h>
+
+export module std.compat;
+export import std;
 
+#ifdef __STDC_VERSION_STDBIT_H__
 // <stdbit.h>
 export
 {
@@ -52,7 +56,9 @@ _GLIBCXX_STDBIT_FUNC(stdc_bit_floor);
 _GLIBCXX_STDBIT_FUNC(stdc_bit_ceil);
 #undef _GLIBCXX_STDBIT_FUNC
 }
+#endif
 
+#ifdef __STDC_VERSION_STDCKDINT_H__
 // <stdckdint.h>
 export
 {
@@ -60,6 +66,7 @@ export
   using __gnu_cxx::ckd_sub;
   using __gnu_cxx::ckd_mul;
 }
+#endif
 
 #define STD_COMPAT 1

Reply via email to