r254515 - Amending r254423 by deleting the copy constructor and adding a move constructor instead; NFC as neither of these constructors are currently called, but this is a safer design.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 09:57:35 PST 2015


On Wed, Dec 2, 2015 at 7:05 AM, Aaron Ballman via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: aaronballman
> Date: Wed Dec  2 09:05:47 2015
> New Revision: 254515
>
> URL: http://llvm.org/viewvc/llvm-project?rev=254515&view=rev
> Log:
> Amending r254423 by deleting the copy constructor and adding a move
> constructor instead; NFC as neither of these constructors are currently
> called, but this is a safer design.
>
> Modified:
>     cfe/trunk/include/clang/Sema/AttributeList.h
>
> Modified: cfe/trunk/include/clang/Sema/AttributeList.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?rev=254515&r1=254514&r2=254515&view=diff
>
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/AttributeList.h (original)
> +++ cfe/trunk/include/clang/Sema/AttributeList.h Wed Dec  2 09:05:47 2015
> @@ -557,6 +557,13 @@ public:
>    /// Create a new pool for a factory.
>    AttributePool(AttributeFactory &factory) : Factory(factory),
> Head(nullptr) {}
>
> +  AttributePool(AttributePool &) = delete;
>

FWIW, once you add the move ctor, the copy ctor is implicitly deleted anyway


> +
> +  /// Move the given pool's allocations to this pool.
> +  AttributePool(AttributePool &&pool) : Factory(pool.Factory),
> Head(pool.Head) {
> +    pool.Head = nullptr;
> +  }
> +
>    AttributeFactory &getFactory() const { return Factory; }
>
>    void clear() {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151202/5acca2a7/attachment.html>


More information about the cfe-commits mailing list