[PATCH] D24602: [libc++] Fix and document visibility attributes for Clang, GCC and Windows.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 02:26:58 PDT 2016


EricWF added inline comments.

================
Comment at: include/__config:605
@@ +604,3 @@
+#  if __has_attribute(__type_visibility__)
+#    define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
+#  else
----------------
Checking `__type_visibility__` and using `__visibility__`  looks weird but is intended as it's meant to override `__type_visibility__`.

================
Comment at: include/__string:704
@@ -703,2 +703,3 @@
 template<class _Ptr>
-size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __do_string_hash(_Ptr __p, _Ptr __e)
----------------
This suppresses the GCC diagnostic `warning: always_inline function might not be inlinable [-Wattributes]` .


https://reviews.llvm.org/D24602





More information about the cfe-commits mailing list