aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-04-06 15:11:15 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-05-06 14:43:39 +0100
commit488d268728bf701ac76a1392eaed202c80be3843 (patch)
treef82e0eaf6647f2978dd74c0486c0a6e3fc386f2a /libstdc++-v3/libsupc++
parente03a0a4d73a478928b26213363fa5dbb9fc8695f (diff)
downloadgcc-488d268728bf701ac76a1392eaed202c80be3843.zip
gcc-488d268728bf701ac76a1392eaed202c80be3843.tar.gz
gcc-488d268728bf701ac76a1392eaed202c80be3843.tar.bz2
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.
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/compare6
-rw-r--r--libstdc++-v3/libsupc++/exception8
-rw-r--r--libstdc++-v3/libsupc++/exception.h6
-rw-r--r--libstdc++-v3/libsupc++/exception_ptr.h6
-rw-r--r--libstdc++-v3/libsupc++/initializer_list6
-rw-r--r--libstdc++-v3/libsupc++/nested_exception.h8
6 files changed, 7 insertions, 33 deletions
diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare
index e9cf913..066867e 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 <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
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index ae2b0dd..24c9129 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 <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>
diff --git a/libstdc++-v3/libsupc++/exception.h b/libstdc++-v3/libsupc++/exception.h
index 7d90518..1df02bd 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 <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
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 6433f05..21c53f6 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 <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
diff --git a/libstdc++-v3/libsupc++/initializer_list b/libstdc++-v3/libsupc++/initializer_list
index 79d32b2..efa1f16 100644
--- a/libstdc++-v3/libsupc++/initializer_list
+++ b/libstdc++-v3/libsupc++/initializer_list
@@ -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
diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h
index 6f0d539..002a54e 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 <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