From patchwork Mon Jul 6 16:13:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1323710 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=lAxO1bwj; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B0rGG1zmkz9sRK for ; Tue, 7 Jul 2020 02:13:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 862C1385700C; Mon, 6 Jul 2020 16:13:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 862C1385700C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594052003; bh=gQoLqHONg2UEUGg+CGKGRCXAiTb9dWD4JBmzx4DyJSU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lAxO1bwjy3gRtXHhMBvKUJZ9F7MbB3AJtolSfyaq2o5CzqGchb2EDJDMJchuuYCt9 t0elw8pkhzFCW4eD12lzbNA1q3Vw4+gbqh6/K/C+yB8WbOmTyAezkTBVZcnWqgu4cA W/TqFMVSghv8LGD3He87rrpVJHxrxFurYyfJyAYU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id CD5EC3858D35 for ; Mon, 6 Jul 2020 16:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CD5EC3858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-Qm0uPAp3NkaRoEDFACz62A-1; Mon, 06 Jul 2020 12:13:17 -0400 X-MC-Unique: Qm0uPAp3NkaRoEDFACz62A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7CD9A18A8221; Mon, 6 Jul 2020 16:13:16 +0000 (UTC) Received: from localhost (unknown [10.33.36.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5E0971674; Mon, 6 Jul 2020 16:13:15 +0000 (UTC) Date: Mon, 6 Jul 2020 17:13:15 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix -Wmismatched-tags warnings (PR 96063) Message-ID: <20200706161315.GA707006@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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. Tested powerpc64le-linux, committed to trunk. commit 0e5abeb0cb06f9798a559e1238839c5d6581657e Author: Jonathan Wakely Date: Mon Jul 6 16:19:23 2020 +0100 libstdc++: Fix -Wmismatched-tags warnings (PR 96063) 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. diff --git a/libstdc++-v3/include/bits/fs_dir.h b/libstdc++-v3/include/bits/fs_dir.h index 686dfce6e5f..264fa783bbb 100644 --- a/libstdc++-v3/include/bits/fs_dir.h +++ b/libstdc++-v3/include/bits/fs_dir.h @@ -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; diff --git a/libstdc++-v3/include/bits/localefwd.h b/libstdc++-v3/include/bits/localefwd.h index 8fecc0b6525..824b07b6476 100644 --- a/libstdc++-v3/include/bits/localefwd.h +++ b/libstdc++-v3/include/bits/localefwd.h @@ -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 class ctype; template<> class ctype; @@ -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 class messages; diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h index 4032fd7559b..31ebcc1eb86 100644 --- a/libstdc++-v3/include/bits/regex.h +++ b/libstdc++-v3/include/bits/regex.h @@ -77,12 +77,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 * satisfies the requirements of such a traits class. */ template - struct regex_traits + class regex_traits { public: typedef _Ch_type char_type; typedef std::basic_string string_type; typedef std::locale locale_type; + private: struct _RegexMask { diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 2772d11462e..7120f9bcfc8 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -635,7 +635,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } template - friend class std::_Rb_tree_merge_helper; + friend struct std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 65f4d0117a4..2791a3c6b3c 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -651,7 +651,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } template - friend class std::_Rb_tree_merge_helper; + friend struct std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index bf6ae7de095..34ba7364f15 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -589,7 +589,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_equal(__hint, std::move(__nh)); } template - friend class std::_Rb_tree_merge_helper; + friend struct std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index da426650815..c8631279c1f 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -604,7 +604,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { return _M_t._M_reinsert_node_hint_unique(__hint, std::move(__nh)); } template - friend class std::_Rb_tree_merge_helper; + friend struct std::_Rb_tree_merge_helper; template void diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index f2917b8c368..db147f47b13 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -124,8 +124,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @param Tp Type of real and imaginary values. */ template - 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 specialization template<> - struct complex + class complex { + public: typedef float value_type; typedef __complex__ float _ComplexT; @@ -1224,8 +1226,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// 26.2.3 complex specializations /// complex specialization template<> - struct complex + class complex { + public: typedef double value_type; typedef __complex__ double _ComplexT; @@ -1369,8 +1372,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// 26.2.3 complex specializations /// complex specialization template<> - struct complex + class complex { + public: typedef long double value_type; typedef __complex__ long double _ComplexT; diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 2a9b2a003db..124bdadd4c7 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -395,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Type of the function object returned from bind(). template - struct _Bind; + class _Bind; template class _Bind<_Functor(_Bound_args...)> @@ -546,7 +546,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Type of the function object returned from bind(). template - struct _Bind_result; + class _Bind_result; template class _Bind_result<_Result, _Functor(_Bound_args...)> diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index 97506a27e37..6eef6864f4d 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -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 friend class _State::_Setter; + template 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 friend class _State::_Setter; + template 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 _Res_type; typedef __future_base::_Ptr<_Res_type> _Ptr_type; - template friend class _State::_Setter; + template friend struct _State::_Setter; friend _State; shared_ptr<_State> _M_future; diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index f92b4345895..864b73e25ab 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -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()) { } diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index e1bba0cb29b..0445ab1e319 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -97,7 +97,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: friend class thread; - friend class hash; + friend struct hash; friend bool operator==(id __x, id __y) noexcept; diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 726ad0aabbb..0dc11768a90 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public _Tuple_impl<_Idx + 1, _Tail...>, private _Head_base<_Idx, _Head> { - template friend class _Tuple_impl; + template 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 friend class _Tuple_impl; + template friend struct _Tuple_impl; typedef _Head_base<_Idx, _Head> _Base; diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 9cd3a2df41a..426febccdf9 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2343,7 +2343,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// result_of template - class result_of; + struct result_of; // Sfinae-friendly result_of implementation: diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray index be2e70dc06a..9981b609aab 100644 --- a/libstdc++-v3/include/std/valarray +++ b/libstdc++-v3/include/std/valarray @@ -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