Use _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY in valarray to support attribute((inter...
authorEric Fiselier <eric@efcs.ca>
Fri, 16 Sep 2016 00:13:55 +0000 (00:13 +0000)
committerEric Fiselier <eric@efcs.ca>
Fri, 16 Sep 2016 00:13:55 +0000 (00:13 +0000)
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.

llvm-svn: 281684

libcxx/include/valarray

index bde644e..2325c54 100644 (file)
@@ -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: