]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix some -Wunused-parameter warnings
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 Aug 2023 21:01:36 +0000 (22:01 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 9 Aug 2023 14:19:15 +0000 (15:19 +0100)
libstdc++-v3/ChangeLog:

* include/bits/alloc_traits.h (allocate): Add [[maybe_unused]]
attribute.
* include/bits/regex_executor.tcc: Remove name of unused
parameter.
* include/bits/shared_ptr_atomic.h (atomic_is_lock_free):
Likewise.
* include/bits/stl_uninitialized.h: Likewise.
* include/bits/streambuf_iterator.h (operator==): Likewise.
* include/bits/uses_allocator.h: Likewise.
* include/c_global/cmath (isfinite, isinf, isnan): Likewise.
* include/std/chrono (zoned_time): Likewise.
* include/std/future (__future_base::_S_allocate_result):
Likewise.
(packaged_task): Likewise.
* include/std/optional (_Optional_payload_base): Likewise.
* include/std/scoped_allocator (__inner_type_impl): Likewise.
* include/std/tuple (_Tuple_impl): Likewise.

12 files changed:
libstdc++-v3/include/bits/alloc_traits.h
libstdc++-v3/include/bits/regex_executor.tcc
libstdc++-v3/include/bits/shared_ptr_atomic.h
libstdc++-v3/include/bits/stl_uninitialized.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/include/bits/uses_allocator.h
libstdc++-v3/include/c_global/cmath
libstdc++-v3/include/std/chrono
libstdc++-v3/include/std/future
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/scoped_allocator
libstdc++-v3/include/std/tuple

index 182c3e23eedacf01355a9647877276a7bc95e00e..bc936ec15dd7e7d2724626ab3e2f622e2a76f044 100644 (file)
@@ -493,7 +493,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       */
       [[__nodiscard__,__gnu__::__always_inline__]]
       static _GLIBCXX20_CONSTEXPR pointer
-      allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
+      allocate(allocator_type& __a, size_type __n,
+              [[maybe_unused]] const_void_pointer __hint)
       {
 #if __cplusplus <= 201703L
        return __a.allocate(__n, __hint);
index 38fbe3dc854dc9bc0ff4b1c9ff821c2c25c9c39f..9643a3575d7c42ca0f0c4907fbb8f8a67001f480 100644 (file)
@@ -339,7 +339,7 @@ namespace __detail
   template<typename _BiIter, typename _TraitsT>
     struct _Backref_matcher
     {
-      _Backref_matcher(bool __icase, const _TraitsT& __traits)
+      _Backref_matcher(bool /* __icase */, const _TraitsT& __traits)
       : _M_traits(__traits) { }
 
       bool
index 2295b48e7326cbc4cc09b08c9d732e9965b51af8..3f921d311d69c6da6d1af7134a135b39a07ac3af 100644 (file)
@@ -99,7 +99,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   */
   template<typename _Tp, _Lock_policy _Lp>
     inline bool
-    atomic_is_lock_free(const __shared_ptr<_Tp, _Lp>* __p)
+    atomic_is_lock_free(const __shared_ptr<_Tp, _Lp>*)
     {
 #ifdef __GTHREADS
       return __gthread_active_p() == 0;
index be7b4afdd05fa78b00535562e2a670ec66715920..474a9a11297dbc89c64785f8a8ba8a451fd57ec2 100644 (file)
@@ -806,8 +806,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
       template<typename _ForwardIterator>
         static void
-        __uninit_default_novalue(_ForwardIterator __first,
-                                _ForwardIterator __last)
+        __uninit_default_novalue(_ForwardIterator, _ForwardIterator)
        {
        }
     };
index 32285a668fc40a6ef4dd008eb6ba547815c213ad..14a95ad42c2c1ccb2f17349c7f510d7ab8771293 100644 (file)
@@ -223,7 +223,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #if __cplusplus > 201703L && __cpp_lib_concepts
       [[nodiscard]]
       friend bool
-      operator==(const istreambuf_iterator& __i, default_sentinel_t __s)
+      operator==(const istreambuf_iterator& __i, default_sentinel_t)
       { return __i._M_at_eof(); }
 #endif
     };
index d3b26c7d9745a2e0b2b9460ef755dc822acc53c2..ebd26d291b3cae7b1b6bc0d7538ce01a20537c4d 100644 (file)
@@ -168,7 +168,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif // C++14
 
   template<typename _Tp, typename... _Args>
-    void __uses_allocator_construct_impl(__uses_alloc0 __a, _Tp* __ptr,
+    void __uses_allocator_construct_impl(__uses_alloc0, _Tp* __ptr,
                                         _Args&&... __args)
     { ::new ((void*)__ptr) _Tp(std::forward<_Args>(__args)...); }
 
index b0ba395eb5cdcd21d773fd952468043d66437b27..caa95e340c8d484e53908808cbdcb0e13f932640 100644 (file)
@@ -1135,7 +1135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp>
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                               bool>::__type
-    isfinite(_Tp __x)
+    isfinite(_Tp)
     { return true; }
 #endif
 
@@ -1162,7 +1162,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp>
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                               bool>::__type
-    isinf(_Tp __x)
+    isinf(_Tp)
     { return false; }
 #endif
 
@@ -1189,7 +1189,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp>
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                               bool>::__type
-    isnan(_Tp __x)
+    isnan(_Tp)
     { return false; }
 #endif
 
index 660e8d2b7460b5d5d384e382bbe4b3f9e3d75e32..9b160488afa9da21bb106c2a6b410619166086ff 100644 (file)
@@ -3039,7 +3039,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        template<typename _Duration2, typename _TimeZonePtr2>
          zoned_time(_TimeZonePtr __z,
                     const zoned_time<_Duration2, _TimeZonePtr2>& __zt,
-                    choose __c)
+                    choose)
          requires is_convertible_v<sys_time<_Duration2>, sys_time<_Duration>>
          : _M_zone(__z), _M_tp(__zt._M_tp)
          { }
@@ -3057,7 +3057,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        template<typename _Duration2, typename _TimeZonePtr2>
          zoned_time(string_view __name,
                     const zoned_time<_Duration2, _TimeZonePtr2>& __zt,
-                    choose __c)
+                    choose)
          requires is_convertible_v<sys_time<_Duration2>, sys_time<_Duration>>
          && requires {
            { _Traits::locate_zone(__name) } -> convertible_to<_TimeZonePtr>;
index 95b413a2e51a67b530da534c6338d3b1bab9c2e0..b94ae0b679b288f853c0f1d84cd1a83ae67f4979 100644 (file)
@@ -314,7 +314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // Keep it simple for std::allocator.
     template<typename _Res, typename _Tp>
       static _Ptr<_Result<_Res>>
-      _S_allocate_result(const std::allocator<_Tp>& __a)
+      _S_allocate_result(const std::allocator<_Tp>&)
       {
        return _Ptr<_Result<_Res>>(new _Result<_Res>);
       }
@@ -1574,7 +1574,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 2095.  missing constructors needed for uses-allocator construction
       template<typename _Allocator>
-       packaged_task(allocator_arg_t, const _Allocator& __a) noexcept
+       packaged_task(allocator_arg_t, const _Allocator&) noexcept
        { }
 
       template<typename _Allocator>
index bcac15227014f19432215f372725a84b2cfa53c5..85e814c3fb8334c0c445c7b37ae4fcc484c66d15 100644 (file)
@@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // Constructor used by _Optional_base copy constructor when the
       // contained value is not trivially copy constructible.
       constexpr
-      _Optional_payload_base(bool __engaged,
+      _Optional_payload_base(bool /* __engaged */,
                             const _Optional_payload_base& __other)
       {
        if (__other._M_engaged)
@@ -148,7 +148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // Constructor used by _Optional_base move constructor when the
       // contained value is not trivially move constructible.
       constexpr
-      _Optional_payload_base(bool __engaged,
+      _Optional_payload_base(bool /* __engaged */,
                             _Optional_payload_base&& __other)
       {
        if (__other._M_engaged)
index a11545026bae3ac8347821441feec6c8e5c64a28..cb15c8cc7dde4a42a38039dd3918b922da4d9ab1 100644 (file)
@@ -104,11 +104,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __inner_type_impl& operator=(__inner_type_impl&&) = default;
 
       template<typename _Alloc>
-      __inner_type_impl(const __inner_type_impl<_Alloc>& __other) noexcept
+      __inner_type_impl(const __inner_type_impl<_Alloc>&) noexcept
       { }
 
       template<typename _Alloc>
-      __inner_type_impl(__inner_type_impl<_Alloc>&& __other) noexcept
+      __inner_type_impl(__inner_type_impl<_Alloc>&&) noexcept
       { }
 
       __type&
index 0e47abed573e6f832ca5bf14de43e9ea409de1f5..c9ea2a892b4ca4e3666bd6590b1bc7a02c9dece8 100644 (file)
@@ -564,14 +564,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Alloc>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    const _Head& __head)
        : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), __head)
        { }
 
       template<typename _Alloc, typename _UHead>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    _UHead&& __head)
        : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
                std::forward<_UHead>(__head))
@@ -579,14 +579,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Alloc>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    const _Tuple_impl& __in)
        : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), _M_head(__in))
        { }
 
       template<typename _Alloc>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    _Tuple_impl&& __in)
        : _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
                std::forward<_Head>(_M_head(__in)))
@@ -594,7 +594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Alloc, typename _UHead>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    const _Tuple_impl<_Idx, _UHead>& __in)
        : _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a),
                _Tuple_impl<_Idx, _UHead>::_M_head(__in))
@@ -602,7 +602,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Alloc, typename _UHead>
        _GLIBCXX20_CONSTEXPR
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    _Tuple_impl<_Idx, _UHead>&& __in)
        : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
                std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))
@@ -611,7 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #if __cplusplus > 202002L
       template<typename _Alloc, typename _UHead>
        constexpr
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    _Tuple_impl<_Idx, _UHead>& __in)
        : _Base(__use_alloc<_Head, _Alloc, _UHead&>(__a),
                _Tuple_impl<_Idx, _UHead>::_M_head(__in))
@@ -619,7 +619,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _Alloc, typename _UHead>
        constexpr
-       _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
+       _Tuple_impl(allocator_arg_t, const _Alloc& __a,
                    const _Tuple_impl<_Idx, _UHead>&& __in)
        : _Base(__use_alloc<_Head, _Alloc, const _UHead>(__a),
                std::forward<const _UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)))