public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/104019] Testsuite 17_intro/headers/c++2020/stdc++_multiple_inclusion.cc failures
Date: Mon, 24 Jan 2022 12:34:02 +0000	[thread overview]
Message-ID: <bug-104019-4-8k1bwDps7i@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104019-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104019

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |61596

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Rimvydas (RJ) from comment #8)
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h: In member function 'void
> std::_Sp_counted_array_base<_Alloc>::_M_init(typename
> std::allocator_traits<_Alloc>::value_type*, _Init)':
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:767: warning: typedef 'using value_type = using _Up =
> typename std::allocator_traits<_Alloc>::value_type' locally defined but not
> used [-Wunused-local-typedefs]
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:768: warning: typedef 'using difference_type =
> std::ptrdiff_t' locally defined but not used [-Wunused-local-typedefs]
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/bits/
> shared_ptr_base.h:771: warning: typedef 'using iterator_category = struct
> std::forward_iterator_tag' locally defined but not used
> [-Wunused-local-typedefs]

These warnings are bogus, those typedefs are not "local" because they are
members of a local class, and they are 100% necessary. This is PR 61596.


> In file included from
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/x86_64-unknown-
> dragonfly6.3/bits/stdc++.h:144:
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch: In
> member function 'void std::latch::count_down(std::ptrdiff_t)':
> /build/trunk/x86_64-unknown-dragonfly6.3/libstdc++-v3/include/latch:65:
> warning: comparison of integer expressions of different signedness: 'const
> long unsigned int' and 'std::ptrdiff_t' {aka 'long int'} [-Wsign-compare]

This would fix it, but needs checking carefully:

--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -60,9 +60,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     _GLIBCXX_ALWAYS_INLINE void
     count_down(ptrdiff_t __update = 1)
     {
+      __glibcxx_assert(__update >= 0);
+
       auto const __old = __atomic_impl::fetch_sub(&_M_a,
-                                   __update, memory_order::release);
-      if (__old == __update)
+                                                 __update,
+                                                 memory_order::release);
+      if (__old == static_cast<__detail::__platform_wait_t>(__update))
        __atomic_impl::notify_all(&_M_a);
     }


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61596
[Bug 61596] -Wunused-local-typedefs warns incorrectly on a typedef that's
referenced indirectly

  parent reply	other threads:[~2022-01-24 12:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  6:06 [Bug libstdc++/104019] New: " rimvydas.jas at gmail dot com
2022-01-15  8:58 ` [Bug libstdc++/104019] " pinskia at gcc dot gnu.org
2022-01-15  9:36 ` redi at gcc dot gnu.org
2022-01-15 12:22 ` redi at gcc dot gnu.org
2022-01-15 12:23 ` redi at gcc dot gnu.org
2022-01-21 13:55 ` redi at gcc dot gnu.org
2022-01-21 16:08 ` cvs-commit at gcc dot gnu.org
2022-01-21 16:10 ` redi at gcc dot gnu.org
2022-01-23 22:49 ` cvs-commit at gcc dot gnu.org
2022-01-23 22:54 ` redi at gcc dot gnu.org
2022-01-24  5:57 ` rimvydas.jas at gmail dot com
2022-01-24  6:02 ` rimvydas.jas at gmail dot com
2022-01-24 12:23 ` redi at gcc dot gnu.org
2022-01-24 12:34 ` redi at gcc dot gnu.org [this message]
2022-01-25 21:09 ` cvs-commit at gcc dot gnu.org
2022-05-06  8:32 ` jakub at gcc dot gnu.org
2022-05-20 10:06 ` redi at gcc dot gnu.org
2023-05-08 12:23 ` rguenth at gcc dot gnu.org

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=bug-104019-4-8k1bwDps7i@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).