[patch] libstdc++/63219 remove stray template parameter

Jonathan Wakely jwakely@redhat.com
Thu Sep 11 10:39:00 GMT 2014


Fix a mistake in the declaration.

The trunk patch also fixes a few warnings that show up with
-Wsystem-headers.

Tested x86_64-linux, committed to trunk and the 4.9 branch.
-------------- next part --------------
commit 4f02e789f77c1d72a75fad0206dbde7728f41c23
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 11 10:38:49 2014 +0100

    	PR libstdc++/63219
    	* include/bits/regex.h (match_results::format): Remove stray template
    	parameter.
    	* include/bits/regex_compiler.h (_RegexTranslator::_RegexTranslator):
    	Remove parameter name to avoid -Wunused-parameter warning.
    	* include/bits/regex_executor.h (_State_info::_State_info): Reorder
    	mem-initializers to avoid -Wreorder warning.
    	* include/bits/regex_executor.tcc (_Executor::_M_word_boundary):
    	Remove parameter name to avoid -Wunused-parameter warning.
    	* include/bits/regex_scanner.tcc (_Scanner::_M_advance): Add braces
    	to avoid -Wempty-body warning when not in debug mode.

diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index e556350..9dc83fd 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -1814,7 +1814,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /**
        * @pre   ready() == true
        */
-      template<typename _Out_iter, typename _St, typename _Sa>
+      template<typename _St, typename _Sa>
 	basic_string<char_type, _St, _Sa>
 	format(const basic_string<char_type, _St, _Sa>& __fmt,
 	       match_flag_type __flags = regex_constants::format_default) const
diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h
index ca116de..1193a5a 100644
--- a/libstdc++-v3/include/bits/regex_compiler.h
+++ b/libstdc++-v3/include/bits/regex_compiler.h
@@ -212,7 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef _CharT                       _StrTransT;
 
       explicit
-      _RegexTranslator(const _TraitsT& __traits)
+      _RegexTranslator(const _TraitsT&)
       { }
 
       _CharT
diff --git a/libstdc++-v3/include/bits/regex_executor.h b/libstdc++-v3/include/bits/regex_executor.h
index 40d3443..130bc74 100644
--- a/libstdc++-v3/include/bits/regex_executor.h
+++ b/libstdc++-v3/include/bits/regex_executor.h
@@ -159,7 +159,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	{
 	  explicit
 	  _State_info(_StateIdT __start, size_t __n)
-	  : _M_start(__start), _M_visited_states(new bool[__n]())
+	  : _M_visited_states(new bool[__n]()), _M_start(__start)
 	  { }
 
 	  bool _M_visited(_StateIdT __i)
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc
index 3c68668..3ca7de3 100644
--- a/libstdc++-v3/include/bits/regex_executor.tcc
+++ b/libstdc++-v3/include/bits/regex_executor.tcc
@@ -407,7 +407,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _BiIter, typename _Alloc, typename _TraitsT,
 	   bool __dfs_mode>
     bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
-    _M_word_boundary(_State<_TraitsT> __state) const
+    _M_word_boundary(_State<_TraitsT>) const
     {
       // By definition.
       bool __ans = false;
diff --git a/libstdc++-v3/include/bits/regex_scanner.tcc b/libstdc++-v3/include/bits/regex_scanner.tcc
index 818e47b..1dc2fd9 100644
--- a/libstdc++-v3/include/bits/regex_scanner.tcc
+++ b/libstdc++-v3/include/bits/regex_scanner.tcc
@@ -83,7 +83,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       else if (_M_state == _S_state_in_brace)
 	_M_scan_in_brace();
       else
-	_GLIBCXX_DEBUG_ASSERT(false);
+	{
+	  _GLIBCXX_DEBUG_ASSERT(false);
+	}
     }
 
   // Differences between styles:
-------------- next part --------------
commit 12c8deb05de9f5f56ed0a867a90a738200c01ddc
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 11 11:04:13 2014 +0100

    	PR libstdc++/63219
    	* include/bits/regex.h (match_results::format): Remove stray template
    	parameter.

diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index e556350..9dc83fd 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -1814,7 +1814,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /**
        * @pre   ready() == true
        */
-      template<typename _Out_iter, typename _St, typename _Sa>
+      template<typename _St, typename _Sa>
 	basic_string<char_type, _St, _Sa>
 	format(const basic_string<char_type, _St, _Sa>& __fmt,
 	       match_flag_type __flags = regex_constants::format_default) const


More information about the Gcc-patches mailing list