[PATCH] libstdc++: Export std::byteswap from std.cc.in [PR121373]

Jonathan Wakely jwakely.gcc@gmail.com
Mon Aug 4 06:23:51 GMT 2025


On Sun, 3 Aug 2025, 19:29 hexne, <printfne@gmail.com> wrote:

> std::byteswap was added to the <bit> header file in c++23 and has been
> implemented, but it was not exported in std.cc.in. Therefore, when
> using import std, std::byteswap cannot be used. Exporting it in
> std.cc.in can solve this problem.
>
> Tested on x86_64-linux.
> Signed-off-by: hexne <printfne@gmail.com>
> diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/
> std.cc.in
> index 9301ed90c00..61f0b715b36 100644
> --- a/libstdc++-v3/src/c++23/std.cc.in
> +++ b/libstdc++-v3/src/c++23/std.cc.in
> @@ -663,6 +663,7 @@ export namespace std
>    using std::bit_ceil;
>    using std::bit_floor;
>    using std::bit_width;
> +  using std::byteswap;
>


This needs to be guarded by the feature test macro because std.cc can be
compiled for C++20.


   using std::countl_one;
>    using std::countl_zero;
>    using std::countr_one;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250804/903151f9/attachment.htm>


More information about the Libstdc++ mailing list