public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6229] libstdc++: Fix -Wunused warning
@ 2020-12-17 14:03 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-12-17 14:03 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e

commit r11-6229-g9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Dec 17 13:16:02 2020 +0000

    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.

Diff:
---
 libstdc++-v3/src/c++11/mutex.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/src/c++11/mutex.cc b/libstdc++-v3/src/c++11/mutex.cc
index 4d42bed8ecc..93a5eae391d 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-17 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 14:03 [gcc r11-6229] libstdc++: Fix -Wunused warning Jonathan Wakely

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).