[libcxx-commits] [PATCH] D68364: Implement C++20's P0784 (More constexpr containers)

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 17 13:28:28 PDT 2020


ldionne added a comment.

In D68364#2280187 <https://reviews.llvm.org/D68364#2280187>, @rsmith wrote:

> The mechanism by which this interacts with Clang looks good to me.

Excellent.

> I've not done any detailed analysis to check all the functions made `constexpr` by P0784 are handled by this patch, though.

I spent like 4-5 hours making sure everything was to the spec :-). The only missing part is the `ranges` declarations.



================
Comment at: libcxx/include/version:254
 // # define __cpp_lib_concepts                             201806L
+# define __cpp_lib_constexpr_dynamic_alloc              201907L
 // # define __cpp_lib_constexpr_misc                       201811L
----------------
rsmith wrote:
> Should this be conditioned on compiler support being available?
So.. I've decided not to do that in this patch so far.

The support for constexpr allocation was checked into Clang about a year ago, right? I actually expect this to be a slightly contentious point, but I'd like to assume that we're using a reasonably recent Clang. I don't see a strong point for being able to use new libc++ headers with an old Clang anyway, since vendors usually release the two together. IOW, supporting this would add complexity for virtually no benefit. I do agree it's a slightly more aggressive stance than we've had so far, but this sort of reasonable assumption makes it so much easier to write stuff for libc++.


================
Comment at: libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp:87
+#if TEST_STD_VER > 17
+    static_assert(test());
+#endif
----------------
rsmith wrote:
> I really like this approach to testing this change :)
Thanks! That's how we do for all constexpr-ifications.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68364



More information about the libcxx-commits mailing list