Reducing overhead of compressed_pair

To try to summarize the platform support story so far:

  • All platforms that libc++ supports have long supported [[no_unique_address]], except MSVC and clang-cl.
  • MSVC failed to implement no_unique_address on the first go around (they ignored it), so now they feel they can’t implement it without breaking ABI compat.
  • Clang had to copy that logic into clang-cl to be ABI compatible.
  • MSVC has had [[msvc::no_unique_address]] for long enough that we can use it in libc++
  • Clang doesn’t have an implementation of [[msvc::no_unique_address]], and we need to take some care to ensure that ours is ABI compatible with MSVC.
  • The implementation is covered by https://github.com/llvm/llvm-project/issues/49358 .

So, I take it that the next step is to work on https://github.com/llvm/llvm-project/issues/49358 in clang.

I think we have previously established that Windows users of libc++ don’t prioritize ABI stability because libc++ is not the system standard library there. The major use case for an alternative standard library is to be faster or better than the standard one in some way, so performance and compile time should be prioritzed over ABI stability. So, in conclusion, I don’t think we should worry about waiting too long after fixing the clang issue to start using the new attribute in libc++. Maybe a single release, but not two.