Use default visibility to work around clang -fvisibility-inlines-hidden bug
authorFangrui Song <maskray@google.com>
Fri, 20 Jul 2018 11:24:55 +0000 (11:24 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 20 Jul 2018 11:24:55 +0000 (12:24 +0100)
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  <maskray@google.com>

* include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Use
_GLIBCXX_VISIBILITY(default).

From-SVN: r262903

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr_base.h

index 71a63db93e8666ab7dabd0faeac0cbeb15136a71..93d847a7fe41b255eef0551ac666e18520afffe5 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-20  Fangrui Song  <maskray@google.com>
+
+       * include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Use
+       _GLIBCXX_VISIBILITY(default).
+
 2018-07-20  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/86603
index f3994da158f6885e5c23230e9b4c280aaa2b54f5..870aeb9bfdacce07c8ef1e3de149d2465f5ff9dc 100644 (file)
@@ -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<const type_info&>(__tag);