[gcc r15-9711] libstdc++: Fix some Clang -Wsystem-headers warnings in <ranges>

Jonathan Wakely redi@gcc.gnu.org
Mon May 19 13:30:25 GMT 2025


https://gcc.gnu.org/g:06a10db2211615e193b5fbe12aa72128b8b0a366

commit r15-9711-g06a10db2211615e193b5fbe12aa72128b8b0a366
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri May 16 11:54:46 2025 +0100

    libstdc++: Fix some Clang -Wsystem-headers warnings in <ranges>
    
    libstdc++-v3/ChangeLog:
    
            * include/std/ranges (_ZipTransform::operator()): Remove name of
            unused parameter.
            (chunk_view::_Iterator, stride_view::_Iterator): Likewise.
            (join_with_view): Declare _Iterator and _Sentinel as class
            instead of struct.
            (repeat_view): Declare _Iterator as class instead of struct.
    
    Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
    (cherry picked from commit 1197f896ae5558f27baa929a10f66447aaafb681)

Diff:
---
 libstdc++-v3/include/std/ranges | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 9300c364a165..210ac8274fc1 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -5336,7 +5336,7 @@ namespace views::__adaptor
 	requires move_constructible<decay_t<_Fp>> && regular_invocable<decay_t<_Fp>&>
 	  && is_object_v<decay_t<invoke_result_t<decay_t<_Fp>&>>>
 	constexpr auto
-	operator() [[nodiscard]] (_Fp&& __f) const
+	operator() [[nodiscard]] (_Fp&&) const
 	{
 	  return views::empty<decay_t<invoke_result_t<decay_t<_Fp>&>>>;
 	}
@@ -6598,7 +6598,7 @@ namespace views::__adaptor
     }
 
     friend constexpr difference_type
-    operator-(default_sentinel_t __y, const _Iterator& __x)
+    operator-(default_sentinel_t, const _Iterator& __x)
       requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>>
     { return __detail::__div_ceil(__x._M_end - __x._M_current, __x._M_n); }
 
@@ -7287,8 +7287,8 @@ namespace views::__adaptor
 	using iterator_category = decltype(_S_iter_cat());
     };
 
-    template<bool> struct _Iterator;
-    template<bool> struct _Sentinel;
+    template<bool> class _Iterator;
+    template<bool> class _Sentinel;
 
   public:
     join_with_view() requires (default_initializable<_Vp>
@@ -7743,7 +7743,7 @@ namespace views::__adaptor
     __detail::__box<_Tp> _M_value;
     [[no_unique_address]] _Bound _M_bound = _Bound();
 
-    struct _Iterator;
+    class _Iterator;
 
     template<typename _Range>
     friend constexpr auto
@@ -8303,7 +8303,7 @@ namespace views::__adaptor
     }
 
     friend constexpr difference_type
-    operator-(default_sentinel_t __y, const _Iterator& __x)
+    operator-(default_sentinel_t, const _Iterator& __x)
       requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>>
     { return __detail::__div_ceil(__x._M_end - __x._M_current, __x._M_stride); }


More information about the Libstdc++-cvs mailing list