From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81E76385840D; Mon, 24 Jan 2022 12:34:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81E76385840D From: "redi at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: dependson Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2022 12:34:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104019 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |61596 --- Comment #11 from Jonathan Wakely --- (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 =3D using _Up = =3D > typename std::allocator_traits<_Alloc>::value_type' locally defined but n= ot > 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 =3D > 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 =3D stru= ct > 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-unkn= own- > 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 =3D 1) { + __glibcxx_assert(__update >=3D 0); + auto const __old =3D __atomic_impl::fetch_sub(&_M_a, - __update, memory_order::release); - if (__old =3D=3D __update) + __update, + memory_order::release); + if (__old =3D=3D static_cast<__detail::__platform_wait_t>(__update)) __atomic_impl::notify_all(&_M_a); } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61596 [Bug 61596] -Wunused-local-typedefs warns incorrectly on a typedef that's referenced indirectly=