public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r14-3839] libstdc++: Fix -Wunused-parameter warnings
Date: Mon, 11 Sep 2023 12:18:01 +0000 (GMT)	[thread overview]
Message-ID: <20230911121801.7201C3858D28@sourceware.org> (raw)

https://gcc.gnu.org/g:390fa3a78c84d97783afda9278df70d4a4ac2471

commit r14-3839-g390fa3a78c84d97783afda9278df70d4a4ac2471
Author: Pekka Seppänen <pexu@gcc.mail.kapsi.fi>
Date:   Thu Sep 7 22:30:00 2023 +0300

    libstdc++: Fix -Wunused-parameter warnings
    
    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>

Diff:
---
 libstdc++-v3/src/c++11/cow-locale_init.cc | 5 +++--
 libstdc++-v3/src/c++17/fs_path.cc         | 2 +-
 libstdc++-v3/src/filesystem/path.cc       | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/src/c++11/cow-locale_init.cc b/libstdc++-v3/src/c++11/cow-locale_init.cc
index 852777634272..f48561f5b12b 100644
--- a/libstdc++-v3/src/c++11/cow-locale_init.cc
+++ b/libstdc++-v3/src/c++11/cow-locale_init.cc
@@ -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);
 
diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc
index aaea7d2725db..d65b5482e8b9 100644
--- a/libstdc++-v3/src/c++17/fs_path.cc
+++ b/libstdc++-v3/src/c++17/fs_path.cc
@@ -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);
diff --git a/libstdc++-v3/src/filesystem/path.cc b/libstdc++-v3/src/filesystem/path.cc
index 4c218bdae497..d04ba6d465d2 100644
--- a/libstdc++-v3/src/filesystem/path.cc
+++ b/libstdc++-v3/src/filesystem/path.cc
@@ -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);

                 reply	other threads:[~2023-09-11 12:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230911121801.7201C3858D28@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).