From 3f14c4b62bc2d7bbd9ede6b3f3e2fed2f18a6515 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 8 Aug 2023 22:07:29 +0100 Subject: [PATCH] libstdc++: Fix some -Wmismatched-tags warnings libstdc++-v3/ChangeLog: * include/bits/shared_ptr_atomic.h (atomic): Change class-head to struct. * include/bits/stl_tree.h (_Rb_tree_merge_helper): Change class-head to struct in friend declaration. * include/std/chrono (tzdb_list::_Node): Likewise. * include/std/future (_Task_state_base, _Task_state): Likewise. * include/std/scoped_allocator (__inner_type_impl): Likewise. * include/std/valarray (_BinClos, _SClos, _GClos, _IClos) (_ValFunClos, _RefFunClos): Change class-head to struct. (cherry picked from commit 5b46eacc4949ec62ee718b172cf8eb056ff27654) --- libstdc++-v3/include/bits/shared_ptr_atomic.h | 8 ++++---- libstdc++-v3/include/bits/stl_tree.h | 2 +- libstdc++-v3/include/std/chrono | 6 +++--- libstdc++-v3/include/std/future | 4 ++-- libstdc++-v3/include/std/scoped_allocator | 4 ++-- libstdc++-v3/include/std/valarray | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/include/bits/shared_ptr_atomic.h b/libstdc++-v3/include/bits/shared_ptr_atomic.h index 3f921d311d69..b56b8153a89f 100644 --- a/libstdc++-v3/include/bits/shared_ptr_atomic.h +++ b/libstdc++-v3/include/bits/shared_ptr_atomic.h @@ -358,7 +358,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 202002L # define __cpp_lib_atomic_shared_ptr 201711L template - class atomic; + struct atomic; /** * @addtogroup pointer_abstractions @@ -376,7 +376,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { using value_type = _Tp; - friend class atomic<_Tp>; + friend struct atomic<_Tp>; // An atomic version of __shared_count<> and __weak_count<>. // Stores a _Sp_counted_base<>* but uses the LSB as a lock. @@ -610,7 +610,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; template - class atomic> + struct atomic> { public: using value_type = shared_ptr<_Tp>; @@ -733,7 +733,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; template - class atomic> + struct atomic> { public: using value_type = weak_ptr<_Tp>; diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index 3c331fbc952a..f870f3dfa538 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -1554,7 +1554,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = _Rb_tree<_Key, _Val, _KeyOfValue, _Compare2, _Alloc>; template - friend class _Rb_tree_merge_helper; + friend struct _Rb_tree_merge_helper; /// Merge from a compatible container into one with unique keys. template diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index 72d73a9abd8c..ac7febbaa2c6 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -2800,7 +2800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: friend const tzdb& reload_tzdb(); - friend class tzdb_list::_Node; + friend struct tzdb_list::_Node; explicit time_zone_link(nullptr_t) { } @@ -2904,7 +2904,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: explicit leap_second(seconds::rep __s) : _M_s(__s) { } - friend class tzdb_list::_Node; + friend struct tzdb_list::_Node; friend const tzdb& reload_tzdb(); @@ -2945,7 +2945,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: friend const tzdb& reload_tzdb(); friend class time_zone; - friend class tzdb_list::_Node; + friend struct tzdb_list::_Node; }; tzdb_list& get_tzdb_list(); diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index b94ae0b679b2..c46ead742c30 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -625,10 +625,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class _Async_state_impl; template - class _Task_state_base; + struct _Task_state_base; template - class _Task_state; + struct _Task_state; template diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator index cb15c8cc7dde..8af432ada425 100644 --- a/libstdc++-v3/include/std/scoped_allocator +++ b/libstdc++-v3/include/std/scoped_allocator @@ -164,7 +164,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return _M_inner == __other._M_inner; } private: - template friend class __inner_type_impl; + template friend struct __inner_type_impl; template friend class scoped_allocator_adaptor; __type _M_inner; @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION friend class scoped_allocator_adaptor; template - friend class __inner_type_impl; + friend struct __inner_type_impl; tuple _M_tie() const noexcept diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray index 6bd23e0914b0..f172db6c623e 100644 --- a/libstdc++-v3/include/std/valarray +++ b/libstdc++-v3/include/std/valarray @@ -62,22 +62,22 @@ namespace __detail template class _Meta1, template class _Meta2, class _Dom1, class _Dom2> - class _BinClos; + struct _BinClos; template class _Meta, class _Dom> - class _SClos; + struct _SClos; template class _Meta, class _Dom> - class _GClos; + struct _GClos; template class _Meta, class _Dom> - class _IClos; + struct _IClos; template class _Meta, class _Dom> - class _ValFunClos; + struct _ValFunClos; template class _Meta, class _Dom> - class _RefFunClos; + struct _RefFunClos; } // namespace __detail using __detail::_UnClos; -- 2.47.2