public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix some -Wunused-parameter warnings
@ 2023-08-09 14:21 Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2023-08-09 14:21 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested x86_64-linux. Pushed to trunk.

-- >8 --

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.
---
 libstdc++-v3/include/bits/alloc_traits.h       |  3 ++-
 libstdc++-v3/include/bits/regex_executor.tcc   |  2 +-
 libstdc++-v3/include/bits/shared_ptr_atomic.h  |  2 +-
 libstdc++-v3/include/bits/stl_uninitialized.h  |  3 +--
 libstdc++-v3/include/bits/streambuf_iterator.h |  2 +-
 libstdc++-v3/include/bits/uses_allocator.h     |  2 +-
 libstdc++-v3/include/c_global/cmath            |  6 +++---
 libstdc++-v3/include/std/chrono                |  4 ++--
 libstdc++-v3/include/std/future                |  4 ++--
 libstdc++-v3/include/std/optional              |  4 ++--
 libstdc++-v3/include/std/scoped_allocator      |  4 ++--
 libstdc++-v3/include/std/tuple                 | 16 ++++++++--------
 12 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 182c3e23eed..bc936ec15dd 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -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);
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc
index 38fbe3dc854..9643a3575d7 100644
--- a/libstdc++-v3/include/bits/regex_executor.tcc
+++ b/libstdc++-v3/include/bits/regex_executor.tcc
@@ -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
diff --git a/libstdc++-v3/include/bits/shared_ptr_atomic.h b/libstdc++-v3/include/bits/shared_ptr_atomic.h
index 2295b48e732..3f921d311d6 100644
--- a/libstdc++-v3/include/bits/shared_ptr_atomic.h
+++ b/libstdc++-v3/include/bits/shared_ptr_atomic.h
@@ -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;
diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h
index be7b4afdd05..474a9a11297 100644
--- a/libstdc++-v3/include/bits/stl_uninitialized.h
+++ b/libstdc++-v3/include/bits/stl_uninitialized.h
@@ -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)
 	{
 	}
     };
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index 32285a668fc..14a95ad42c2 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -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
     };
diff --git a/libstdc++-v3/include/bits/uses_allocator.h b/libstdc++-v3/include/bits/uses_allocator.h
index d3b26c7d974..ebd26d291b3 100644
--- a/libstdc++-v3/include/bits/uses_allocator.h
+++ b/libstdc++-v3/include/bits/uses_allocator.h
@@ -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)...); }
 
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index b0ba395eb5c..caa95e340c8 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -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
 
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 660e8d2b746..9b160488afa 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -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>;
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index 95b413a2e51..b94ae0b679b 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -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>
diff --git a/libstdc++-v3/include/std/optional b/libstdc++-v3/include/std/optional
index bcac1522701..85e814c3fb8 100644
--- a/libstdc++-v3/include/std/optional
+++ b/libstdc++-v3/include/std/optional
@@ -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)
diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator
index a11545026ba..cb15c8cc7dd 100644
--- a/libstdc++-v3/include/std/scoped_allocator
+++ b/libstdc++-v3/include/std/scoped_allocator
@@ -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&
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 0e47abed573..c9ea2a892b4 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -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)))
-- 
2.41.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [committed] libstdc++: Fix some -Wunused-parameter warnings
@ 2020-09-10 16:10 Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2020-09-10 16:10 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

libstdc++-v3/ChangeLog:

	* include/bits/codecvt.h (codecvt_byname): Remove names of
	unused parameters.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1085 bytes --]

commit 36efcd7de0431b099087d8ae1ad358b0e088a250
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 17:09:16 2020

    libstdc++: Fix some -Wunused-parameter warnings
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/codecvt.h (codecvt_byname): Remove names of
            unused parameters.

diff --git a/libstdc++-v3/include/bits/codecvt.h b/libstdc++-v3/include/bits/codecvt.h
index f6e20f0649c..e6efa166109 100644
--- a/libstdc++-v3/include/bits/codecvt.h
+++ b/libstdc++-v3/include/bits/codecvt.h
@@ -763,7 +763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
     public:
       explicit
-      codecvt_byname(const char* __s, size_t __refs = 0)
+      codecvt_byname(const char*, size_t __refs = 0)
       : codecvt<char16_t, char8_t, mbstate_t>(__refs) { }
 
       explicit
@@ -781,7 +781,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
     public:
       explicit
-      codecvt_byname(const char* __s, size_t __refs = 0)
+      codecvt_byname(const char*, size_t __refs = 0)
       : codecvt<char32_t, char8_t, mbstate_t>(__refs) { }
 
       explicit

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-09 14:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09 14:21 [committed] libstdc++: Fix some -Wunused-parameter warnings Jonathan Wakely
  -- strict thread matches above, loose matches on Subject: below --
2020-09-10 16:10 Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).