]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wunused-parameter warnings
authorPekka Seppänen <pexu@gcc.mail.kapsi.fi>
Thu, 7 Sep 2023 19:30:00 +0000 (22:30 +0300)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 11 Sep 2023 11:36:18 +0000 (12:36 +0100)
Fix -Wunused-parameter warnings when _GLIBCXX_USE_WCHAR_T is not
defined.

libstdc++-v3/ChangeLog:

* src/c++11/cow-locale_init.cc: Add [[maybe_unused]] attribute.
* src/c++17/fs_path.cc (path::_S_convert_loc): Likewise.
* src/filesystem/path.cc (path::_S_convert_loc): Likewise.

Signed-off-by: Pekka Seppänen <pexu@gcc.mail.kapsi.fi>
libstdc++-v3/src/c++11/cow-locale_init.cc
libstdc++-v3/src/c++17/fs_path.cc
libstdc++-v3/src/filesystem/path.cc

index 8527776342728ac132735baa9fac334e502f9907..f48561f5b12bd7c78ce2cce38bedabe0e1a68a45 100644 (file)
@@ -137,8 +137,9 @@ namespace
   }
 
   void
-  locale::_Impl::_M_init_extra(void* cloc, void* clocm,
-                               const char* __s, const char* __smon)
+  locale::_Impl::_M_init_extra(void* cloc, [[maybe_unused]] void* clocm,
+                              const char* __s,
+                              [[maybe_unused]] const char* __smon)
   {
     auto& __cloc = *static_cast<__c_locale*>(cloc);
 
index aaea7d2725dbd3b1d286e650eb38bb249a536ff2..d65b5482e8b969b3609b278bf7fd82b5e25ce4ac 100644 (file)
@@ -1947,7 +1947,7 @@ path::_M_split_cmpts()
 
 path::string_type
 path::_S_convert_loc(const char* __first, const char* __last,
-                    const std::locale& __loc)
+                    [[maybe_unused]] const std::locale& __loc)
 {
 #if _GLIBCXX_USE_WCHAR_T
   auto& __cvt = std::use_facet<codecvt<wchar_t, char, mbstate_t>>(__loc);
index 4c218bdae4978e0e5e48ebb776e4a5f303b1f96f..d04ba6d465d2af3069a6f3163927a66e0c3e986f 100644 (file)
@@ -498,7 +498,7 @@ path::_M_trim()
 
 path::string_type
 path::_S_convert_loc(const char* __first, const char* __last,
-                    const std::locale& __loc)
+                    [[maybe_unused]] const std::locale& __loc)
 {
 #if _GLIBCXX_USE_WCHAR_T
   auto& __cvt = std::use_facet<codecvt<wchar_t, char, mbstate_t>>(__loc);