diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-12-17 13:16:02 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-12-17 14:03:00 +0000 |
commit | 9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e (patch) | |
tree | 48e7472d1f0e7e6d19e3bd69a277e44e5dda8f27 | |
parent | 8dc63f13f03facc49b777195c9068432477b5dcd (diff) | |
download | gcc-9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e.zip gcc-9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e.tar.gz gcc-9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e.tar.bz2 |
libstdc++: Fix -Wunused warning
As noted in PR 66146 comment 35, there is a new warning in the new
std::call_once implementation.
libstdc++-v3/ChangeLog:
* src/c++11/mutex.cc (std::once_flag::_M_finish): Add
maybe_unused attribute to variable used in assertion.
-rw-r--r-- | libstdc++-v3/src/c++11/mutex.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/src/c++11/mutex.cc b/libstdc++-v3/src/c++11/mutex.cc index 4d42bed..93a5eae 100644 --- a/libstdc++-v3/src/c++11/mutex.cc +++ b/libstdc++-v3/src/c++11/mutex.cc @@ -74,7 +74,8 @@ std::once_flag::_M_finish(bool returning) noexcept } else { - int prev = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE); + int prev [[maybe_unused]] + = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE); __glibcxx_assert(prev & _Bits::_Active); // Wake any other threads waiting for this execution to finish. constexpr int futex_wake = 129; // FUTEX_WAKE_PRIVATE |