[libcxx-commits] [PATCH] D103753: [libc++] [P0619] Add _LIBCPP_ABI_NO_BINDER_BASES and remove binder typedefs in C++20.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jun 6 01:30:54 PDT 2021


Mordante added a comment.

Thanks for the clean-up. I see no big issues, but would like to discuss the backwards compatibility flags before approving.



================
Comment at: libcxx/include/__functional_base:58
     typedef bool __result_type;  // used by valarray
+#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+    typedef bool result_type;
----------------
I'm not entirely happy with this construction. IIRC @ldionne considered not adding these `_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS` flags anymore. If we don't add this enable macro we can simplify the code by only omitting the base class only in C++20 with the unstable API.


================
Comment at: libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp:27
     const F f = F(std::logical_and<int>());
+#if TEST_STD_VER <= 17
     static_assert((std::is_same<int, F::first_argument_type>::value), "" );
----------------
Looking at the similar tests below, this `#if` should be removed due to using `-D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103753



More information about the libcxx-commits mailing list