[PATCH] D35388: [libc++] Give extern templates default visibility on gcc

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 18 15:44:29 PDT 2018


ldionne added a comment.

ABI-wise, I think this change is OK. Indeed, if `__type_visibility__` is not supported, we're already marking the base template as `__visibility__("default")`, so marking the extern template declaration with `__visibility__("default")` is not a problem. If `__type_visibility__` is supported, then there's no change in behavior. So I think there is no change in behavior either way, and I'm actually wondering why @thomasanderson wants this change in if the behavior is always the same. Perhaps I am missing something?

As a diversion, I'm confused by the very fact that we need to apply `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` to the _extern template declaration_. I would have expected instead that, if anything, we need to specify the visibility on the _explicit instantiation_ in the dylib.


https://reviews.llvm.org/D35388





More information about the cfe-commits mailing list