From 2143168e072391eb097a9382ab8ad2ca70ce1d11 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 20 Jul 2018 11:24:55 +0000 Subject: [PATCH] Use default visibility to work around clang -fvisibility-inlines-hidden bug Clang (including trunk and many older versions) incorrectly marks static local variables (__tag) hidden when -fvisibility-inlines-hidden is used. This can lead to multiple instances of __tag when shares objects are used. 2018-07-20 Fangrui Song * include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Use _GLIBCXX_VISIBILITY(default). From-SVN: r262903 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/shared_ptr_base.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 71a63db93e8..93d847a7fe4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2018-07-20 Fangrui Song + + * include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Use + _GLIBCXX_VISIBILITY(default). + 2018-07-20 Jonathan Wakely PR libstdc++/86603 diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index f3994da158f..870aeb9bfda 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -508,7 +508,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION friend class _Sp_counted_ptr_inplace; static const type_info& - _S_ti() noexcept + _S_ti() noexcept _GLIBCXX_VISIBILITY(default) { alignas(type_info) static constexpr _Sp_make_shared_tag __tag; return reinterpret_cast(__tag); -- 2.30.2