[PATCH v2] libstdc++: Fix std::ranges::iota not included in numeric [PR108760]

Michael Levine (BLOOMBERG/ 731 LEX) mlevine55@bloomberg.net
Fri May 17 16:59:53 GMT 2024


This is the revised version of my patch incorporating the provided feedback from Patrick Palka and Jonathan Wakely.

This patch fixes GCC Bug 108760: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108760

I moved out_value_result to <bits/ranges_algobase.h>, moved std::ranges:iota into <numeric>, removed my new test, and moved and renamed the existing test.

I built my local version of gcc using the following configuration:  $ ../gcc/configure --disable-bootstrap --prefix="$(pwd)/_pfx/" --enable-languages=c,c++,lto
I then ran $ make -jN 
and $ make -jN install

Using the locally installed version, the following code compiled:  https://godbolt.org/z/33EPeqd1b

I tested my changes by running:  $ make check-c++ -jN -k
I personally found it difficult to understand the results of running the tests.

I ran this on the following OS:

Virtualization: wsl
Operating System: Ubuntu 20.04.6 LTS
Kernel: Linux 5.15.146.1-microsoft-standard-WSL2
Architecture: x86-64


From: Michael Levine (BLOOMBERG/ 731 LEX) At: 04/17/24 14:24:24 UTC-4:00To:  libstdc++@gcc.gnu.org,  gcc-patches@gcc.gnu.org
Subject: [PATCH] libstdc++: Fix std::ranges::iota is not included in numeric [PR108760]
This patch fixes GCC Bug 108760:  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108760

Before this patch, using std::ranges::iota required including <algorithm> when it should have been sufficient to only include <numeric>.

When the patch is applied, the following code will compile:  https://godbolt.org/z/33EPeqd1b

I added a test case for this change as well.

I built my local version of gcc using the following configuration:  $ ../gcc/configure --disable-bootstrap --prefix="$(pwd)/_pfx/" --enable-languages=c,c++,lto

and I tested my changes by running:  $ make check-c++ -jN -k

I ran this on the following OS:

Virtualization: wsl
Operating System: Ubuntu 20.04.6 LTS
Kernel: Linux 5.15.146.1-microsoft-standard-WSL2
Architecture: x86-64


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20240517/ca27abab/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 108760v2.patch
Type: application/octet-stream
Size: 25249 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20240517/ca27abab/attachment-0001.obj>


More information about the Libstdc++ mailing list