From 9ed83a33c0a826cb190f60552d930c38a80ad46c Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 4 Dec 2017 23:07:39 +0000 Subject: 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) (codecvt_byname): 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 --- libstdc++-v3/include/std/streambuf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libstdc++-v3/include/std/streambuf') diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf index c1fd395..34fa9a4 100644 --- a/libstdc++-v3/include/std/streambuf +++ b/libstdc++-v3/include/std/streambuf @@ -46,6 +46,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#define _IsUnused __attribute__ ((__unused__)) + template streamsize __copy_streambufs_eof(basic_streambuf<_CharT, _Traits>*, @@ -578,7 +580,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @note Base class version does nothing. */ virtual void - imbue(const locale& __loc) + imbue(const locale& __loc _IsUnused) { } // [27.5.2.4.2] buffer management and positioning @@ -726,7 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @note Base class version does nothing, returns eof(). */ virtual int_type - pbackfail(int_type __c = traits_type::eof()) + pbackfail(int_type __c _IsUnused = traits_type::eof()) { return traits_type::eof(); } // Put area: @@ -770,7 +772,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @note Base class version does nothing, returns eof(). */ virtual int_type - overflow(int_type __c = traits_type::eof()) + overflow(int_type __c _IsUnused = traits_type::eof()) { return traits_type::eof(); } #if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L @@ -852,6 +854,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION basic_streambuf* __sbout, bool& __ineof); #endif +#undef _IsUnused + _GLIBCXX_END_NAMESPACE_VERSION } // namespace -- cgit v1.1