From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by sourceware.org (Postfix) with ESMTPS id 1451F385626C for ; Fri, 6 May 2022 13:45:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1451F385626C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-395-XGM9npJ0PB6jA57GvyIR1g-1; Fri, 06 May 2022 09:45:32 -0400 X-MC-Unique: XGM9npJ0PB6jA57GvyIR1g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5E6CE2999B53; Fri, 6 May 2022 13:45:32 +0000 (UTC) Received: from localhost (unknown [10.33.36.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27281C28119; Fri, 6 May 2022 13:45:32 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Do not use #include inside push visibility scope [PR99871] Date: Fri, 6 May 2022 14:45:31 +0100 Message-Id: <20220506134531.3330924-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.6 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 13:45:35 -0000 Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/99871 * include/bits/specfun.h: Use visibility attribute on namespace, instead of pragma push/pop. * libsupc++/compare: Likewise. * libsupc++/exception: Likewise. * libsupc++/exception.h: Likewise. * libsupc++/exception_ptr.h: Likewise. * libsupc++/initializer_list: Likewise. * libsupc++/nested_exception.h: Likewise. --- libstdc++-v3/include/bits/specfun.h | 4 ---- libstdc++-v3/libsupc++/compare | 6 +----- libstdc++-v3/libsupc++/exception | 8 ++------ libstdc++-v3/libsupc++/exception.h | 6 +----- libstdc++-v3/libsupc++/exception_ptr.h | 6 +----- libstdc++-v3/libsupc++/initializer_list | 6 +----- libstdc++-v3/libsupc++/nested_exception.h | 8 +------- 7 files changed, 7 insertions(+), 37 deletions(-) diff --git a/libstdc++-v3/include/bits/specfun.h b/libstdc++-v3/include/bits/specfun.h index cac350217b8..a12b04b3ea7 100644 --- a/libstdc++-v3/include/bits/specfun.h +++ b/libstdc++-v3/include/bits/specfun.h @@ -30,8 +30,6 @@ #ifndef _GLIBCXX_BITS_SPECFUN_H #define _GLIBCXX_BITS_SPECFUN_H 1 -#pragma GCC visibility push(default) - #include #define __STDCPP_MATH_SPEC_FUNCS__ 201003L @@ -1385,6 +1383,4 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx #endif // __STRICT_ANSI__ -#pragma GCC visibility pop - #endif // _GLIBCXX_BITS_SPECFUN_H diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare index e9cf9139def..066867e9ce1 100644 --- a/libstdc++-v3/libsupc++/compare +++ b/libstdc++-v3/libsupc++/compare @@ -34,15 +34,13 @@ #if __cplusplus > 201703L && __cpp_impl_three_way_comparison >= 201907L -#pragma GCC visibility push(default) - #include #if __cpp_lib_concepts # define __cpp_lib_three_way_comparison 201907L #endif -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { // [cmp.categories], comparison category types @@ -1239,8 +1237,6 @@ namespace std #endif // concepts } // namespace std -#pragma GCC visibility pop - #endif // C++20 #endif // _COMPARE diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception index ae2b0dd7f78..24c91292a16 100644 --- a/libstdc++-v3/libsupc++/exception +++ b/libstdc++-v3/libsupc++/exception @@ -32,14 +32,12 @@ #pragma GCC system_header -#pragma GCC visibility push(default) - #include #include extern "C++" { -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { /** @addtogroup exceptions * @{ @@ -135,7 +133,7 @@ namespace std /// @} group exceptions } // namespace std -namespace __gnu_cxx +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -162,8 +160,6 @@ _GLIBCXX_END_NAMESPACE_VERSION } // extern "C++" -#pragma GCC visibility pop - #if (__cplusplus >= 201103L) #include #include diff --git a/libstdc++-v3/libsupc++/exception.h b/libstdc++-v3/libsupc++/exception.h index 7d905184c64..1df02bddc1b 100644 --- a/libstdc++-v3/libsupc++/exception.h +++ b/libstdc++-v3/libsupc++/exception.h @@ -33,13 +33,11 @@ #pragma GCC system_header -#pragma GCC visibility push(default) - #include extern "C++" { -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { /** * @defgroup exceptions Exceptions @@ -82,6 +80,4 @@ namespace std } -#pragma GCC visibility pop - #endif diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index 6433f059e9c..21c53f686ba 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -31,8 +31,6 @@ #ifndef _EXCEPTION_PTR_H #define _EXCEPTION_PTR_H -#pragma GCC visibility push(default) - #include #include #include @@ -51,7 +49,7 @@ extern "C++" { -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { class type_info; @@ -283,6 +281,4 @@ namespace std } // extern "C++" -#pragma GCC visibility pop - #endif diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list index 79d32b219b4..efa1f164cde 100644 --- a/libstdc++-v3/libsupc++/initializer_list +++ b/libstdc++-v3/libsupc++/initializer_list @@ -36,11 +36,9 @@ # include #else // C++0x -#pragma GCC visibility push(default) - #include -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { /// initializer_list template @@ -102,8 +100,6 @@ namespace std { return __ils.end(); } } -#pragma GCC visibility pop - #endif // C++11 #endif // _INITIALIZER_LIST diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h index 6f0d5399708..002a54e9fef 100644 --- a/libstdc++-v3/libsupc++/nested_exception.h +++ b/libstdc++-v3/libsupc++/nested_exception.h @@ -30,18 +30,15 @@ #ifndef _GLIBCXX_NESTED_EXCEPTION_H #define _GLIBCXX_NESTED_EXCEPTION_H 1 -#pragma GCC visibility push(default) - #if __cplusplus < 201103L # include #else -#include #include extern "C++" { -namespace std +namespace std _GLIBCXX_VISIBILITY(default) { /** * @addtogroup exceptions @@ -165,7 +162,4 @@ namespace std } // extern "C++" #endif // C++11 - -#pragma GCC visibility pop - #endif // _GLIBCXX_NESTED_EXCEPTION_H -- 2.34.1