[libcxx-commits] [PATCH] D106763: [libc++][RFC] Disable incomplete library features.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 26 14:33:39 PDT 2021


ldionne added a comment.

In D106763#2904182 <https://reviews.llvm.org/D106763#2904182>, @Mordante wrote:

> @cjdb @zoecarver is our ranges implementation in main affected by the ABI breaking papers accepted in the June plenary?

I don't think there's any remaining ABI breaks to be performed because of changes in the spec, however we still want to reserve the right for ABI breaks for a little bit. For example, I'm not sure the ABI for `non-propagating-cache` is final.

I actually gave more thought to this, and I think what we want is:

1. Add a macro in `__config_site` like `_LIBCPP_HAS_NO_INCOMPLETE_FEATURES`.
2. Add a CMake option `LIBCXX_ENABLE_INCOMPLETE_FEATURES` that sets this macro in `__config_site`. By default, that option should be set to `ON` so that we enable incomplete features by default.
3. Add a macro in `features.py` like: `'_LIBCPP_HAS_NO_INCOMPLETE_FEATURES': 'libcpp-has-no-incomplete-features'`, and mark the relevant tests as `UNSUPPORTED`.
4. Set `set(LIBCXX_ENABLE_INCOMPLETE_FEATURES OFF CACHE BOOL "")` in `Apple.cmake`.

That way, incomplete features are always enabled by default (i.e. the current state of things). Enabling them does not require any specific action. However, when we want to ship libc++ (as a vendor or as part of the LLVM distribution), we can disable the incomplete features when configuring CMake.

The benefits of doing it that way is that it's better integrated with the rest of the code -- that's how we disable all kinds of other features. Also, it's not clear to me that we want to give users the ability to override this option. It's not like using something in `std::experimental`, it's really more like using something that isn't fully baked yet.

If you agree and we go in that direction, we should also move the documentation for the option to `BuildingLibcxx.rst`, which is aimed at vendors instead of end-users.



================
Comment at: libcxx/include/ranges:184
+#ifndef _LIBCPP_ENABLE_CXX20_INCOMPLETE_RANGES
+#error The implementation of the ranges library is incomplete define _LIBCPP_ENABLE_CXX20_INCOMPLETE_RANGES to use it.
+#endif
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106763/new/

https://reviews.llvm.org/D106763



More information about the libcxx-commits mailing list