[PATCH] D119580: [LLVM][Support] Delete non-const lvalue ref "copy" constructor of BumpPtrAllocatorImpl
Zixu Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 11 14:49:54 PST 2022
zixuw added inline comments.
================
Comment at: llvm/include/llvm/Support/Allocator.h:85
+ template <typename T>
+ BumpPtrAllocatorImpl(BumpPtrAllocatorImpl<T> &) = delete;
+
----------------
efriedma wrote:
> This isn't using the right template parameters. I'd suggest just `BumpPtrAllocatorImpl(const BumpPtrAllocatorImpl &) = delete;`. Or I guess you could do something like `template <typename AllocatorT, size_t SlabSize, size_t SizeThreshold, size_t GrowthDelay> BumpPtrAllocatorImpl(const BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold, GrowthDelay> &) = delete;`.
Ahh makes sense.
> just `BumpPtrAllocatorImpl(const BumpPtrAllocatorImpl &) = delete;`
IIUC this would just delete the case where `BumpPtrAllocatorImpl` with the same template arguments right? I guess I should go with the full thing.
Also I need to drop the `const` apparently because otherwise the perfect-forwarding will always be a better match.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119580/new/
https://reviews.llvm.org/D119580
More information about the llvm-commits
mailing list