Commit 9ed83a33 by Jonathan Wakely Committed by Jonathan Wakely

Fix -Wunused warnings in libstdc++ headers

	* config/io/basic_file_stdio.h (__basic_file): Remove name of unused
	parameter.
	* include/bits/boost_concept_check.h: Add pragmas to disable
	-Wunused-local-typedef warnings.
	* include/bits/codecvt.h (codecvt_byname<char16_t, char, mbstate_t>)
	(codecvt_byname<char32_t, char, mbstate_t>): Remove name of unused
	parameter.
	* include/bits/locale_facets_nonio.tcc (time_get::do_get_weekday)
	(time_get::do_get_monthname, time_get::do_get_year): Remove unused
	variables.
	* include/std/bitset (_Base_bitset<0>::_M_getword): Remove name of
	unused parameter.
	* include/std/streambuf (_IsUnused): Define.
	(basic_streambuf::imbue, basic_streambuf::pbackfail)
	(basic_streambuf::overflow): Add macro to unused parameters.
	* testsuite/24_iterators/operations/prev_neg.cc: Adjust dg-error.

From-SVN: r255391
parent 899ac3b8
2017-12-04 Jonathan Wakely <jwakely@redhat.com>
* config/io/basic_file_stdio.h (__basic_file): Remove name of unused
parameter.
* include/bits/boost_concept_check.h: Add pragmas to disable
-Wunused-local-typedef warnings.
* include/bits/codecvt.h (codecvt_byname<char16_t, char, mbstate_t>)
(codecvt_byname<char32_t, char, mbstate_t>): Remove name of unused
parameter.
* include/bits/locale_facets_nonio.tcc (time_get::do_get_weekday)
(time_get::do_get_monthname, time_get::do_get_year): Remove unused
variables.
* include/std/bitset (_Base_bitset<0>::_M_getword): Remove name of
unused parameter.
* include/std/streambuf (_IsUnused): Define.
(basic_streambuf::imbue, basic_streambuf::pbackfail)
(basic_streambuf::overflow): Add macro to unused parameters.
* testsuite/24_iterators/operations/prev_neg.cc: Adjust dg-error.
2017-12-01 Jonathan Wakely <jwakely@redhat.com> 2017-12-01 Jonathan Wakely <jwakely@redhat.com>
* include/experimental/string_view (basic_string_view::_S_compare): * include/experimental/string_view (basic_string_view::_S_compare):
......
...@@ -63,7 +63,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -63,7 +63,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__basic_file(__c_lock* __lock = 0) throw (); __basic_file(__c_lock* __lock = 0) throw ();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
__basic_file(__basic_file&& __rv, __c_lock* __lock = 0) noexcept __basic_file(__basic_file&& __rv, __c_lock* = 0) noexcept
: _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created) : _M_cfile(__rv._M_cfile), _M_cfile_created(__rv._M_cfile_created)
{ {
__rv._M_cfile = nullptr; __rv._M_cfile = nullptr;
......
...@@ -48,6 +48,9 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) ...@@ -48,6 +48,9 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#define _IsUnused __attribute__ ((__unused__)) #define _IsUnused __attribute__ ((__unused__))
// When the C-C code is in use, we would like this function to do as little // When the C-C code is in use, we would like this function to do as little
...@@ -783,6 +786,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; }; ...@@ -783,6 +786,7 @@ struct _Aux_require_same<_Tp,_Tp> { typedef _Tp _Type; };
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#pragma GCC diagnostic pop
#undef _IsUnused #undef _IsUnused
#endif // _GLIBCXX_BOOST_CONCEPT_CHECK #endif // _GLIBCXX_BOOST_CONCEPT_CHECK
......
...@@ -612,7 +612,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -612,7 +612,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit explicit
codecvt_byname(const char* __s, size_t __refs = 0) codecvt_byname(const char*, size_t __refs = 0)
: codecvt<char16_t, char, mbstate_t>(__refs) { } : codecvt<char16_t, char, mbstate_t>(__refs) { }
explicit explicit
...@@ -630,7 +630,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -630,7 +630,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
public: public:
explicit explicit
codecvt_byname(const char* __s, size_t __refs = 0) codecvt_byname(const char*, size_t __refs = 0)
: codecvt<char32_t, char, mbstate_t>(__refs) { } : codecvt<char32_t, char, mbstate_t>(__refs) { }
explicit explicit
......
...@@ -1096,7 +1096,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 ...@@ -1096,7 +1096,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
{ {
const locale& __loc = __io._M_getloc(); const locale& __loc = __io._M_getloc();
const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const char_type* __days[14]; const char_type* __days[14];
__tp._M_days_abbreviated(__days); __tp._M_days_abbreviated(__days);
__tp._M_days(__days + 7); __tp._M_days(__days + 7);
...@@ -1123,7 +1122,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 ...@@ -1123,7 +1122,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
{ {
const locale& __loc = __io._M_getloc(); const locale& __loc = __io._M_getloc();
const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc); const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const char_type* __months[24]; const char_type* __months[24];
__tp._M_months_abbreviated(__months); __tp._M_months_abbreviated(__months);
__tp._M_months(__months + 12); __tp._M_months(__months + 12);
...@@ -1148,8 +1146,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 ...@@ -1148,8 +1146,6 @@ _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11
do_get_year(iter_type __beg, iter_type __end, ios_base& __io, do_get_year(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, tm* __tm) const ios_base::iostate& __err, tm* __tm) const
{ {
const locale& __loc = __io._M_getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
int __tmpyear; int __tmpyear;
ios_base::iostate __tmperr = ios_base::goodbit; ios_base::iostate __tmperr = ios_base::goodbit;
......
...@@ -561,7 +561,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER ...@@ -561,7 +561,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
} }
_GLIBCXX_CONSTEXPR _WordT _GLIBCXX_CONSTEXPR _WordT
_M_getword(size_t __pos) const _GLIBCXX_NOEXCEPT _M_getword(size_t) const _GLIBCXX_NOEXCEPT
{ return 0; } { return 0; }
_GLIBCXX_CONSTEXPR _WordT _GLIBCXX_CONSTEXPR _WordT
......
...@@ -46,6 +46,8 @@ namespace std _GLIBCXX_VISIBILITY(default) ...@@ -46,6 +46,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define _IsUnused __attribute__ ((__unused__))
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
streamsize streamsize
__copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*, __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*,
...@@ -578,7 +580,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -578,7 +580,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @note Base class version does nothing. * @note Base class version does nothing.
*/ */
virtual void virtual void
imbue(const locale& __loc) imbue(const locale& __loc _IsUnused)
{ } { }
// [27.5.2.4.2] buffer management and positioning // [27.5.2.4.2] buffer management and positioning
...@@ -726,7 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -726,7 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @note Base class version does nothing, returns eof(). * @note Base class version does nothing, returns eof().
*/ */
virtual int_type virtual int_type
pbackfail(int_type __c = traits_type::eof()) pbackfail(int_type __c _IsUnused = traits_type::eof())
{ return traits_type::eof(); } { return traits_type::eof(); }
// Put area: // Put area:
...@@ -770,7 +772,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -770,7 +772,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @note Base class version does nothing, returns eof(). * @note Base class version does nothing, returns eof().
*/ */
virtual int_type virtual int_type
overflow(int_type __c = traits_type::eof()) overflow(int_type __c _IsUnused = traits_type::eof())
{ return traits_type::eof(); } { return traits_type::eof(); }
#if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L #if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L
...@@ -852,6 +854,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -852,6 +854,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
basic_streambuf<wchar_t>* __sbout, bool& __ineof); basic_streambuf<wchar_t>* __sbout, bool& __ineof);
#endif #endif
#undef _IsUnused
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
......
...@@ -38,5 +38,5 @@ test02() ...@@ -38,5 +38,5 @@ test02()
{ {
const Y array[1] = { }; const Y array[1] = { };
std::prev(array + 1); std::prev(array + 1);
// { dg-error "forward_iterator" "" { target *-*-* } 220 } // { dg-error "forward_iterator" "" { target *-*-* } 223 }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment