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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 11 14:16:34 PDT 2021


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM, but:

1. CI needs to pass
2. Please put the GCC-next CI fixes in a different patch, and don't touch the `iterator.ops` failures (I'm doing that in D103272 <https://reviews.llvm.org/D103272>).
3. We normally add `.verify.cpp` tests to check that we've applied the deprecated attribute properly to stuff -- here this should apply to the typedefs. It's kinda nitpicky but I'd like it if you could add them.



================
Comment at: libcxx/include/functional:555
+#if defined(_LIBCPP_CXX03_LANG) || !defined(_LIBCPP_ABI_NO_BINDER_BASES)
+    : binary_function<_Tp, _Tp, _Tp>
+#endif
----------------
Quuxplusone wrote:
> ldionne wrote:
> > What Standard removed those bases? Is it C++11 or C++14?
> > 
> > Using `_LIBCPP_CXX03_LANG` doesn't look right to me. That macro only means that the compiler supports C++03 language feature, it is not related to the standard version that libc++ tries to implement (which is always C++11 or above).
> These bases are present in C++03 and removed in C++11.
> I was looking at other things new-in-'11 and saw them guarded by `_LIBCPP_CXX03_LANG`, so I copied that here; but that was entirely cargo-cult. I'm happy to remove the guard here, i.e. make it just
> ```
> #if !defined(_LIBCPP_ABI_NO_BINDER_BASES)
> ```
> Will do.
> 
> @ldionne, my understanding is that these days, `_LIBCPP_CXX03_LANG` mode is allowed to assume that the compiler supports `Foo&&` and `decltype` syntaxes as extensions (but maybe not `initializer_list` or `Args...`). Would you be interested in a PR to remove the guards around things like https://github.com/llvm/llvm-project/blob/2d0f1fa/libcxx/include/vector#L703-L712 ?
Yes, very very interested.

To be precise, what we support is Clang in >= C++03 mode (which supports `&&` & friends as extensions), and GCC in >= C++11 mode (which supports `&&` & friends because it's C++11).


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