[libcxx-commits] [PATCH] D69132: [libc++][P0784] Marked allocator constexpr.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 4 06:32:38 PST 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/include/memory:1854
         {
-        if (__n > max_size())
+        if (!__libcpp_is_constant_evaluated() && __n > max_size())
             __throw_length_error("allocator<T>::allocate(size_t n)"
----------------
Isn't it fine to throw inside `constexpr` if we can't allocate?


================
Comment at: libcxx/include/memory:1956
     {
-        if (__n > max_size())
+        if (!__libcpp_is_constant_evaluated() && __n > max_size())
             __throw_length_error("allocator<const T>::allocate(size_t n)"
----------------
Ditto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69132





More information about the libcxx-commits mailing list