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.
This commit is contained in:
Jonathan Wakely 2021-04-06 15:11:15 +01:00
parent e03a0a4d73
commit 488d268728
7 changed files with 7 additions and 37 deletions

View file

@ -30,8 +30,6 @@
#ifndef _GLIBCXX_BITS_SPECFUN_H
#define _GLIBCXX_BITS_SPECFUN_H 1
#pragma GCC visibility push(default)
#include <bits/c++config.h>
#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

View file

@ -34,15 +34,13 @@
#if __cplusplus > 201703L && __cpp_impl_three_way_comparison >= 201907L
#pragma GCC visibility push(default)
#include <concepts>
#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

View file

@ -32,14 +32,12 @@
#pragma GCC system_header
#pragma GCC visibility push(default)
#include <bits/c++config.h>
#include <bits/exception.h>
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 <bits/exception_ptr.h>
#include <bits/nested_exception.h>

View file

@ -33,13 +33,11 @@
#pragma GCC system_header
#pragma GCC visibility push(default)
#include <bits/c++config.h>
extern "C++" {
namespace std
namespace std _GLIBCXX_VISIBILITY(default)
{
/**
* @defgroup exceptions Exceptions
@ -82,6 +80,4 @@ namespace std
}
#pragma GCC visibility pop
#endif

View file

@ -31,8 +31,6 @@
#ifndef _EXCEPTION_PTR_H
#define _EXCEPTION_PTR_H
#pragma GCC visibility push(default)
#include <bits/c++config.h>
#include <bits/exception_defines.h>
#include <bits/cxxabi_init_exception.h>
@ -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

View file

@ -36,11 +36,9 @@
# include <bits/c++0x_warning.h>
#else // C++0x
#pragma GCC visibility push(default)
#include <bits/c++config.h>
namespace std
namespace std _GLIBCXX_VISIBILITY(default)
{
/// initializer_list
template<class _E>
@ -102,8 +100,6 @@ namespace std
{ return __ils.end(); }
}
#pragma GCC visibility pop
#endif // C++11
#endif // _INITIALIZER_LIST

View file

@ -30,18 +30,15 @@
#ifndef _GLIBCXX_NESTED_EXCEPTION_H
#define _GLIBCXX_NESTED_EXCEPTION_H 1
#pragma GCC visibility push(default)
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
#include <bits/c++config.h>
#include <bits/move.h>
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