[libcxx-commits] [PATCH] D104398: [libc++] Make sure std::allocator<void> is always trivial
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 16 10:13:56 PDT 2021
ldionne added inline comments.
================
Comment at: libcxx/include/__memory/allocator.h:83
class _LIBCPP_TEMPLATE_VIS allocator
+ : private __non_trivial_if<!is_void<_Tp>::value, allocator<_Tp> >
{
----------------
@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.
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