[libcxx] r281684 - Use _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY in valarray to support attribute((internal_linkage)).

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 17:13:56 PDT 2016


Author: ericwf
Date: Thu Sep 15 19:13:55 2016
New Revision: 281684

URL: http://llvm.org/viewvc/llvm-project?rev=281684&view=rev
Log:
Use _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY in valarray to support attribute((internal_linkage)).

The externally instantiated member functions must be declared using
_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY, not _LIBCPP_INLINE_VISIBILITY, in
order to be properly exported when using __attribute__((internal_linkage)).

Otherwise the explicit instantiations will obviously have internal linkage and
will not be exported from the dylib.

Modified:
    libcxx/trunk/include/valarray

Modified: libcxx/trunk/include/valarray
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/valarray?rev=281684&r1=281683&r2=281684&view=diff
==============================================================================
--- libcxx/trunk/include/valarray (original)
+++ libcxx/trunk/include/valarray Thu Sep 15 19:13:55 2016
@@ -802,8 +802,8 @@ public:
     // construct/destroy:
     _LIBCPP_INLINE_VISIBILITY
     valarray() : __begin_(0), __end_(0) {}
-    _LIBCPP_INLINE_VISIBILITY
-    inline explicit valarray(size_t __n);
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+    explicit valarray(size_t __n);
     _LIBCPP_INLINE_VISIBILITY
     valarray(const value_type& __x, size_t __n);
     valarray(const value_type* __p, size_t __n);
@@ -819,7 +819,7 @@ public:
     valarray(const gslice_array<value_type>& __ga);
     valarray(const mask_array<value_type>& __ma);
     valarray(const indirect_array<value_type>& __ia);
-    inline _LIBCPP_INLINE_VISIBILITY
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     ~valarray();
 
     // assignment:




More information about the cfe-commits mailing list