public inbox for gcc-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 r12-7005] libstdc++: Fix -Wunused-variable warning for -fno-exceptions build Date: Wed, 2 Feb 2022 20:20:23 +0000 (GMT) [thread overview] Message-ID: <20220202202023.57B333858D37@sourceware.org> (raw) https://gcc.gnu.org/g:2905e1af94519b7ba3c43a57af8a7d5e10815950 commit r12-7005-g2905e1af94519b7ba3c43a57af8a7d5e10815950 Author: Jonathan Wakely <jwakely@redhat.com> Date: Wed Feb 2 11:40:28 2022 +0000 libstdc++: Fix -Wunused-variable warning for -fno-exceptions build If _GLIBCXX_THROW_OR_ABORT expands to just __builtin_abort() then the bool variable used in the filesystem_error constructor is unused. Mark it as maybe_unused to there's no warning for -fno-exceptions builds. libstdc++-v3/ChangeLog: * src/c++17/fs_dir.cc (fs::recursive_directory_iterator::pop): Add [[maybe_unused]] attribute. * src/filesystem/dir.cc (fs::recursive_directory_iterator::pop): Likewise. Diff: --- libstdc++-v3/src/c++17/fs_dir.cc | 2 +- libstdc++-v3/src/filesystem/dir.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc index 149a8b0740c..a77aabb6dcc 100644 --- a/libstdc++-v3/src/c++17/fs_dir.cc +++ b/libstdc++-v3/src/c++17/fs_dir.cc @@ -347,7 +347,7 @@ fs::recursive_directory_iterator::pop(error_code& ec) void fs::recursive_directory_iterator::pop() { - const bool dereferenceable = _M_dirs != nullptr; + [[maybe_unused]] const bool dereferenceable = _M_dirs != nullptr; error_code ec; pop(ec); if (ec) diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc index ac9e70da516..7cf8e62b5e6 100644 --- a/libstdc++-v3/src/filesystem/dir.cc +++ b/libstdc++-v3/src/filesystem/dir.cc @@ -334,7 +334,7 @@ fs::recursive_directory_iterator::pop(error_code& ec) void fs::recursive_directory_iterator::pop() { - const bool dereferenceable = _M_dirs != nullptr; + [[maybe_unused]] const bool dereferenceable = _M_dirs != nullptr; error_code ec; pop(ec); if (ec)
reply other threads:[~2022-02-02 20:20 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=20220202202023.57B333858D37@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: linkBe 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).