]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++/regex: Avoid -Wunused-parameter warnings in _Executor
authorPatrick Palka <ppalka@redhat.com>
Thu, 12 Feb 2026 20:17:57 +0000 (15:17 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 12 Feb 2026 20:17:57 +0000 (15:17 -0500)
Now that _Executor is non-recursive most subroutines no longer use their
_Match_mode parameter (previously it was just passed to recursive _M_dfs
calls).  For now, just make them unnamed to avoid warnings.

libstdc++-v3/ChangeLog:

* include/bits/regex_executor.tcc (_Executor::_M_rep_once_more):
Make unnused _Match_mode parameter unnamed.
(_Executor::_M_handle_repeat): Likewise.
(_Executor::_M_handle_subexpr_begin): Likewise.
(_Executor::_M_handle_subexpr_end): Likewise.
(_Executor::_M_handle_line_begin_assertion): Likewise.
(_Executor::_M_handle_line_end_assertion): Likewise.
(_Executor::_M_handle_match): Likewise.
(_Executor::_M_handle_backref): Likewise.
(_Executor::_M_handle_alternative): Likewise.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/bits/regex_executor.tcc

index 4eda6bdf553181e3508c177e12935432ad821850..167a7a345300868ed5e0852e328569aec47e3d0d 100644 (file)
@@ -252,7 +252,7 @@ namespace __detail
   // we need to spare one more time for potential group capture.
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_rep_once_more(_Match_mode __match_mode, _StateIdT __i)
+    _M_rep_once_more(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       auto& __rep_count = _M_rep_count[__i];
@@ -282,7 +282,7 @@ namespace __detail
   // given greedy mode.
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_repeat(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_repeat(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       // Greedy.
@@ -324,7 +324,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_subexpr_begin(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_subexpr_begin(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       auto& __res = _M_cur_results[__state._M_subexpr];
@@ -337,7 +337,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_subexpr_end(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_subexpr_end(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       auto& __res = _M_cur_results[__state._M_subexpr];
@@ -353,7 +353,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     inline void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_line_begin_assertion(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_line_begin_assertion(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_at_begin())
@@ -362,7 +362,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     inline void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_line_end_assertion(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_line_end_assertion(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_at_end())
@@ -371,7 +371,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     inline void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_word_boundary(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_word_boundary(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_word_boundary() == !__state._M_neg)
@@ -382,7 +382,7 @@ namespace __detail
   // We recursively invoke our algorithm to match the sub-NFA.
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_subexpr_lookahead(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_subexpr_lookahead(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_lookahead(__state._M_alt) == !__state._M_neg)
@@ -391,7 +391,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_match(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_match(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_current == _M_end)
@@ -463,7 +463,7 @@ namespace __detail
   // If matched, keep going; else just return and try another state.
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_backref(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_backref(_Match_mode, _StateIdT __i)
     {
       __glibcxx_assert(_M_search_mode == _Search_mode::_DFS);
 
@@ -540,7 +540,7 @@ namespace __detail
 
   template<typename _BiIter, typename _Alloc, typename _TraitsT>
     void _Executor<_BiIter, _Alloc, _TraitsT>::
-    _M_handle_alternative(_Match_mode __match_mode, _StateIdT __i)
+    _M_handle_alternative(_Match_mode, _StateIdT __i)
     {
       const auto& __state = _M_nfa[__i];
       if (_M_nfa._M_flags & regex_constants::ECMAScript)