[PATCH] D29157: [libc++] Make _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS export members

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 16 21:05:41 PST 2017


smeenai added a comment.

Will do the rebase.



================
Comment at: include/locale:626
     template <class _Fp>
+    _LIBCPP_HIDDEN
     iter_type __do_get_floating_point
----------------
EricWF wrote:
> After applying the changes to `__config` but not this header `check-cxx-abilist` didn't report any changes to these symbols. Why is this needed again?
It's to prevent https://llvm.org/bugs/show_bug.cgi?id=30642 from occurring again. If an extern template class is marked default visibility, and you have template methods of that class which get instantiated in other libraries, those template method instantiations also get marked default visibility, so now other libraries are exporting libc++ symbols. This change marks all such template methods as hidden to prevent the leakage.

That might not be the most clear explanation, so https://ghostbin.com/paste/29y9d demonstrates what I mean. (It's also the root cause of PR30642.)

https://reviews.llvm.org/D25208 addresses the same issue for non-template classes.


================
Comment at: include/string:1100
     template<class _InputIterator>
+        inline _LIBCPP_INLINE_VISIBILITY
         typename enable_if
----------------
EricWF wrote:
> Why `inline _LIBCPP_INLINE_VISIBILITY` here but `_LIBCPP_HIDDEN` everywhere else?
This function is really small, so I figured marking it for inlining was more appropriate.


https://reviews.llvm.org/D29157





More information about the cfe-commits mailing list