[libcxx-commits] [PATCH] D153658: [libc++] Make everything in namespace std have default type visibility and hidden visibility and remove _LIBCPP_ENUM_VIS
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 17 09:41:21 PDT 2023
ldionne added a comment.
Trying to summarize our long discussion just now: I think there are two changes in here.
1. Apply `type_visibility(default)` on `namespace std`. This fixes an existing issue where we most likely are missing some `type_visibility(default)` on types, which means that some types might not work properly with `std::any` and anything related to RTTI, basically (which includes exceptions). This change does have a change of behavior, but it makes things "less strict" in a way, i.e. more code will work than today. Applying `type_visibility(default)` on the namespace also has the side effect that `_LIBCPP_ENUM_VIS` is not required anymore, so we can clean that up if we want (potentially even as a separate patch, IDK).
2. The second change is applying `_LIBCPP_HIDDEN` on `namespace std`. This will have the effect that we stop exporting some functions that we basically forgot to mark as `hidden`, which we arguably want. However, we also have to decide what to do with a bunch of other entities, such as the `_v` variable templates. For those, we have to decide whether we want to keep exporting them or not, and that requires guidance from the Committee (especially since WG21 went through the trouble of making these `inline` variables). If the conclusion is that we need to keep exporting them, then we can either drop this change, or mark `namespace std` as `hidden` but then also apply an explicit `default` visibility to the things we want to export. Those are different approaches and we can discuss them on a patch that tackles just that side of the problem. Also note that we don't necessarily have to wait for WG21 to apply `hidden` to the namespace. The WG21 guidance is only required to know whether we could drop the manual `EXPORT_FROM_ABI` annotation from these `_v` entities if we made `namespace std` have hidden visibility.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153658/new/
https://reviews.llvm.org/D153658
More information about the libcxx-commits
mailing list