diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-02-02 11:40:28 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-02-02 17:55:16 +0000 |
commit | 2905e1af94519b7ba3c43a57af8a7d5e10815950 (patch) | |
tree | 6baf5f87ca5505ea8caa01d497453bceb9ccd69d | |
parent | c123096cf14ac87875bba51279e46cceeb18faa1 (diff) | |
download | gcc-2905e1af94519b7ba3c43a57af8a7d5e10815950.zip gcc-2905e1af94519b7ba3c43a57af8a7d5e10815950.tar.gz gcc-2905e1af94519b7ba3c43a57af8a7d5e10815950.tar.bz2 |
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.
-rw-r--r-- | libstdc++-v3/src/c++17/fs_dir.cc | 2 | ||||
-rw-r--r-- | 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 149a8b0..a77aabb 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 ac9e70d..7cf8e62 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) |