libstdc++: Fix -Wmismatched-tags warnings (PR 96063)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 6 Jul 2020 15:19:23 +0000 (16:19 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 6 Jul 2020 16:12:29 +0000 (17:12 +0100)
libstdc++-v3/ChangeLog:

* include/bits/fs_dir.h: Use consistent tag in class-head.
* include/bits/localefwd.h: Likwise.
* include/bits/regex.h: Likwise.
* include/bits/stl_map.h: Likwise.
* include/bits/stl_multimap.h: Likwise.
* include/bits/stl_multiset.h: Likwise.
* include/bits/stl_set.h: Likwise.
* include/std/complex: Likwise.
* include/std/functional: Likwise.
* include/std/future: Likwise.
* include/std/system_error: Likwise.
* include/std/thread: Likwise.
* include/std/tuple: Likwise.
* include/std/type_traits: Likwise.
* include/std/valarray: Likwise.

15 files changed:
libstdc++-v3/include/bits/fs_dir.h
libstdc++-v3/include/bits/localefwd.h
libstdc++-v3/include/bits/regex.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_multiset.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/include/std/complex
libstdc++-v3/include/std/functional
libstdc++-v3/include/std/future
libstdc++-v3/include/std/system_error
libstdc++-v3/include/std/thread
libstdc++-v3/include/std/tuple
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/std/valarray

index 686dfce6e5fd9f6252a84e30251767fb0cfabe5e..264fa783bbb49b67b8d76dcbc1ff3a3d1cdf2f43 100644 (file)
@@ -312,7 +312,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 #endif
 
   private:
-    friend class _Dir;
+    friend struct _Dir;
     friend class directory_iterator;
     friend class recursive_directory_iterator;
 
index 8fecc0b6525eefbe73fa1274fedabfed95446c58..824b07b6476523a6e72f81e62695287260f3605f 100644 (file)
@@ -122,7 +122,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     tolower(_CharT, const locale&);
 
   // 22.2.1 and 22.2.1.3 ctype
-  class ctype_base;
+  struct ctype_base;
   template<typename _CharT>
     class ctype;
   template<> class ctype<char>;
@@ -200,7 +200,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
 _GLIBCXX_END_NAMESPACE_CXX11
 
   // 22.2.7 message retrieval
-  class messages_base;
+  struct messages_base;
 _GLIBCXX_BEGIN_NAMESPACE_CXX11
   template<typename _CharT>
     class messages;
index 4032fd7559b647d56e45046b06a131bcf566cebb..31ebcc1eb861511634328e93b7fe218d39adc94d 100644 (file)
@@ -77,12 +77,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
    * satisfies the requirements of such a traits class.
    */
   template<typename _Ch_type>
-    struct regex_traits
+    class regex_traits
     {
     public:
       typedef _Ch_type                         char_type;
       typedef std::basic_string<char_type>     string_type;
       typedef std::locale                      locale_type;
+
     private:
       struct _RegexMask
        {
index 2772d11462e11c8ef9ac814444190edf0408eed1..7120f9bcfc81bfd8137c9f051534c08eb55b120f 100644 (file)
@@ -635,7 +635,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); }
 
       template<typename, typename>
-       friend class std::_Rb_tree_merge_helper;
+       friend struct std::_Rb_tree_merge_helper;
 
       template<typename _Cmp2>
        void
index 65f4d0117a42685c0da33e508143f836a4fc7584..2791a3c6b3cd4138089f4ed0ba53ca7ce7b758ab 100644 (file)
@@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); }
 
       template<typename, typename>
-       friend class std::_Rb_tree_merge_helper;
+       friend struct std::_Rb_tree_merge_helper;
 
       template<typename _Cmp2>
        void
index bf6ae7de095f7eea083adf785be3c34f7d5201f7..34ba7364f15e8499d409a0347260b4e25c7f399e 100644 (file)
@@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); }
 
       template<typename, typename>
-       friend class std::_Rb_tree_merge_helper;
+       friend struct std::_Rb_tree_merge_helper;
 
       template<typename _Compare1>
        void
index da426650815a45962aecba166d82601f15f1939e..c8631279c1fce7f460bee75ad023eaa30f3c43d7 100644 (file)
@@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); }
 
       template<typename, typename>
-       friend class std::_Rb_tree_merge_helper;
+       friend struct std::_Rb_tree_merge_helper;
 
       template<typename _Compare1>
        void
index f2917b8c368649d4ae08e52ff9bc99a4e6716858..db147f47b133c6fc56c38a047e1b62af4aef2ab0 100644 (file)
@@ -124,8 +124,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @param  Tp  Type of real and imaginary values.
   */
   template<typename _Tp>
-    struct complex
+    class complex
     {
+    public:
       /// Value typedef.
       typedef _Tp value_type;
 
@@ -1079,8 +1080,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// 26.2.3  complex specializations
   /// complex<float> specialization
   template<>
-    struct complex<float>
+    class complex<float>
     {
+    public:
       typedef float value_type;
       typedef __complex__ float _ComplexT;
 
@@ -1224,8 +1226,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// 26.2.3  complex specializations
   /// complex<double> specialization
   template<>
-    struct complex<double>
+    class complex<double>
     {
+    public:
       typedef double value_type;
       typedef __complex__ double _ComplexT;
 
@@ -1369,8 +1372,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// 26.2.3  complex specializations
   /// complex<long double> specialization
   template<>
-    struct complex<long double>
+    class complex<long double>
     {
+    public:
       typedef long double value_type;
       typedef __complex__ long double _ComplexT;
 
index 2a9b2a003dbb59166ce76be7f7ec72a4cf03e6ef..124bdadd4c7143d9b015679131c4e420f69b1094 100644 (file)
@@ -395,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// Type of the function object returned from bind().
   template<typename _Signature>
-    struct _Bind;
+    class _Bind;
 
    template<typename _Functor, typename... _Bound_args>
     class _Bind<_Functor(_Bound_args...)>
@@ -546,7 +546,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// Type of the function object returned from bind<R>().
   template<typename _Result, typename _Signature>
-    struct _Bind_result;
+    class _Bind_result;
 
   template<typename _Result, typename _Functor, typename... _Bound_args>
     class _Bind_result<_Result, _Functor(_Bound_args...)>
index 97506a27e37c821134c90de9dbd95d8360aff396..6eef6864f4dd40a5c7469a28791d342d2c92ede1 100644 (file)
@@ -1048,7 +1048,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef __future_base::_State_base       _State;
       typedef __future_base::_Result<_Res>     _Res_type;
       typedef __future_base::_Ptr<_Res_type>   _Ptr_type;
-      template<typename, typename> friend class _State::_Setter;
+      template<typename, typename> friend struct _State::_Setter;
       friend _State;
 
       shared_ptr<_State>                        _M_future;
@@ -1159,7 +1159,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef __future_base::_State_base       _State;
       typedef __future_base::_Result<_Res&>    _Res_type;
       typedef __future_base::_Ptr<_Res_type>   _Ptr_type;
-      template<typename, typename> friend class _State::_Setter;
+      template<typename, typename> friend struct _State::_Setter;
       friend _State;
 
       shared_ptr<_State>                        _M_future;
@@ -1249,7 +1249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef __future_base::_State_base       _State;
       typedef __future_base::_Result<void>     _Res_type;
       typedef __future_base::_Ptr<_Res_type>   _Ptr_type;
-      template<typename, typename> friend class _State::_Setter;
+      template<typename, typename> friend struct _State::_Setter;
       friend _State;
 
       shared_ptr<_State>                        _M_future;
index f92b4345895aab9361dc91c42ce01356cc9ed36f..864b73e25abf309307bd99bb248f4a33f92aebf6 100644 (file)
@@ -177,8 +177,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * library might be represented by an HTTP response status code (e.g. 404)
    * and a custom category defined by the library.
    */
-  struct error_code
+  class error_code
   {
+  public:
     error_code() noexcept
     : _M_value(0), _M_cat(&system_category()) { }
 
@@ -275,8 +276,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * An `error_condition` represents something that the program can test for,
    * and subsequently take appropriate action.
    */
-  struct error_condition
+  class error_condition
   {
+  public:
     error_condition() noexcept
     : _M_value(0), _M_cat(&generic_category()) { }
 
index e1bba0cb29b321d0d1e5a25861bdf415883005b5..0445ab1e319e372cf0711af70816f05fecd3aa5f 100644 (file)
@@ -97,7 +97,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     private:
       friend class thread;
-      friend class hash<id>;
+      friend struct hash<id>;
 
       friend bool
       operator==(id __x, id __y) noexcept;
index 726ad0aabbb5e2f37b5147856d7c6b867e15047f..0dc11768a90f3b1cd93e0d838dbf412dcb63e730 100644 (file)
@@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     : public _Tuple_impl<_Idx + 1, _Tail...>,
       private _Head_base<_Idx, _Head>
     {
-      template<size_t, typename...> friend class _Tuple_impl;
+      template<size_t, typename...> friend struct _Tuple_impl;
 
       typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
       typedef _Head_base<_Idx, _Head> _Base;
@@ -341,7 +341,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct _Tuple_impl<_Idx, _Head>
     : private _Head_base<_Idx, _Head>
     {
-      template<size_t, typename...> friend class _Tuple_impl;
+      template<size_t, typename...> friend struct _Tuple_impl;
 
       typedef _Head_base<_Idx, _Head> _Base;
 
index 9cd3a2df41a83b935828a728733b019a5f8139aa..426febccdf95c699a17bd75feaa27f38589688e5 100644 (file)
@@ -2343,7 +2343,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// result_of
   template<typename _Signature>
-    class result_of;
+    struct result_of;
 
   // Sfinae-friendly result_of implementation:
 
index be2e70dc06adce505f5b416d1c3ebf1ccd81fc3c..9981b609aaba80687ae9e3ba49f8354c9dcd773a 100644 (file)
@@ -571,7 +571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       size_t _M_size;
       _Tp* __restrict__ _M_data;
 
-      friend class _Array<_Tp>;
+      friend struct _Array<_Tp>;
     };
 
 #if __cpp_deduction_guides >= 201606