[PATCH] D68364: Implement C++20's P0784 (More constexpr containers)
Jonathan Wakely via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 25 03:27:59 PDT 2020
jwakely added a comment.
In D68364#2293971 <https://reviews.llvm.org/D68364#2293971>, @leonardchan wrote:
> Is there a recommended way for working around this? We're using GCC 10.2.1. Thanks.
I don't think your implementation is valid. I think P0784 only allows new-expressions and calls to `std::allocator::allocate` in constexpr functions, not calls to `operator new`.
Can you use something like `if (__builtin_is_constant_evaluated() return new unsigned char[n];` and the equivalent in the corresponding deallocation function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68364/new/
https://reviews.llvm.org/D68364
More information about the cfe-commits
mailing list