From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 0062A385625D; Fri, 6 May 2022 13:45:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0062A385625D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-152] libstdc++: Do not use #include inside push visibility scope [PR99871] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: e03a0a4d73a478928b26213363fa5dbb9fc8695f X-Git-Newrev: 488d268728bf701ac76a1392eaed202c80be3843 Message-Id: <20220506134511.0062A385625D@sourceware.org> Date: Fri, 6 May 2022 13:45:10 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 13:45:11 -0000 https://gcc.gnu.org/g:488d268728bf701ac76a1392eaed202c80be3843 commit r13-152-g488d268728bf701ac76a1392eaed202c80be3843 Author: Jonathan Wakely Date: Tue Apr 6 15:11:15 2021 +0100 libstdc++: Do not use #include inside push visibility scope [PR99871] 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. Diff: --- 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