[gcc r17-535] libstdc++: Include range_access.h from <optional> and <stacktrace>

Tomasz Kaminski tkaminsk@gcc.gnu.org
Fri May 15 17:27:05 GMT 2026


https://gcc.gnu.org/g:87e4eb4492701426a02f5fcf460bb0b6d432d2b7

commit r17-535-g87e4eb4492701426a02f5fcf460bb0b6d432d2b7
Author: Tomasz Kamiński <tkaminsk@redhat.com>
Date:   Thu May 14 14:47:03 2026 +0200

    libstdc++: Include range_access.h from <optional> and <stacktrace>
    
    This implements resolutions for LWG4131 and LWG3625 (also part of 4.8. section
    of the P3016R6). As for any other issues LWG issue changes are applied as DR
    for the oldest applicable standards:
    * <optional> (LWG4131): C++26, since optional range support
    * <stacktrace> (LWG3625): C++23, since introduction
    
    libstdc++-v3/ChangeLog:
    
            * include/std/optional [__cpp_lib_optional_range_support]:
            Replace <bits/stl_iterator.h> include with <bits/range_access.h>.
            * include/std/stacktrace: Likewise.
    
    Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
    Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>

Diff:
---
 libstdc++-v3/include/std/optional   | 2 +-
 libstdc++-v3/include/std/stacktrace | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/optional b/libstdc++-v3/include/std/optional
index e3c6ea209889..8d6d049e8ccc 100644
--- a/libstdc++-v3/include/std/optional
+++ b/libstdc++-v3/include/std/optional
@@ -62,7 +62,7 @@
 #ifdef __cpp_lib_optional_range_support // C++ >= 26
 # include <bits/formatfwd.h>
 # include <bits/ranges_base.h>
-# include <bits/stl_iterator.h>
+# include <bits/range_access.h>
 #endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/std/stacktrace b/libstdc++-v3/include/std/stacktrace
index 587a163e9766..79941d93b88f 100644
--- a/libstdc++-v3/include/std/stacktrace
+++ b/libstdc++-v3/include/std/stacktrace
@@ -45,9 +45,9 @@
 #include <bits/memory_resource.h>
 #include <bits/stl_algobase.h>
 #include <bits/stl_algo.h>
-#include <bits/stl_iterator.h>
 #include <bits/stl_uninitialized.h>
 #include <bits/stl_tempbuf.h> // __get_temporary_buffer
+#include <bits/range_access.h>
 #include <ext/numeric_traits.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)


More information about the Libstdc++-cvs mailing list