[libcxx-commits] [PATCH] D104398: [libc++] Make sure std::allocator<void> is always trivial
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 16 11:30:17 PDT 2021
Quuxplusone accepted this revision.
Quuxplusone added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libcxx/include/__memory/allocator.h:83
class _LIBCPP_TEMPLATE_VIS allocator
+ : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> >
{
----------------
ldionne wrote:
> @Quuxplusone I'd like you to double-check my reasoning here (see comment above). After thinking about it, I don't think this is an ABI break because of the subtlety where no two types are going to inherit from the same `__non_trivial_if` base class (unless they are the same type, in which case they *already* don't share the same address). So I think this is good, but an extra pair of eyes certainly won't hurt.
>
> Also note that I would have used a trailing-requires-clause in C++20 instead of going through those base class hoops, but https://llvm.org/PR50740 prevents me from doing so.
Sure, LGTM. I haven't thought of any way for this to go wrong.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104398/new/
https://reviews.llvm.org/D104398
More information about the libcxx-commits
mailing list