[libcxx-commits] [libcxx] [libc++] Remove _LIBCPP_COMPRESSED_PAIR/TRIPLE from shared_ptr (PR #200401)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 3 08:03:51 PDT 2026


================
@@ -215,6 +215,8 @@
 #endif
 #define _LIBCPP_HIDE_FROM_ABI_VIRTUAL _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
 
+#define _LIBCPP_HIDE_STRUCT_FROM_ABI [[__gnu__::__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))]]
----------------
ldionne wrote:

I think this *at least* needs a comment, and maybe an entry in the documentation where we document similar things. Please explain what's the intended usage for this.

Also, the name is tricky. It doesn't actually hide the struct from the ABI, it just ensures that the ABI gets broken at each version bump if someone happens to put this type as part of an ABI.

In an ideal world, we'd also have a Clang attribute that would result in a warning/error if the type is used in an ABI-sensitive place (e.g. a function signature for a function that isn't e.g. static). I don't know if that's feasible, but it would have a lot of value.

https://github.com/llvm/llvm-project/pull/200401


More information about the libcxx-commits mailing list