r254423 - It appears that this horrible mutating copy constructor is unused. Kill it with fire.

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 15:42:08 PST 2015


> On 2015-Dec-01, at 09:15, Aaron Ballman via cfe-commits <cfe-commits at lists.llvm.org> wrote:
> 
> Author: aaronballman
> Date: Tue Dec  1 11:15:13 2015
> New Revision: 254423
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=254423&view=rev
> Log:
> It appears that this horrible mutating copy constructor is unused. Kill it with fire.
> 
> 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=254423&r1=254422&r2=254423&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/AttributeList.h (original)
> +++ cfe/trunk/include/clang/Sema/AttributeList.h Tue Dec  1 11:15:13 2015
> @@ -557,11 +557,6 @@ public:
>   /// Create a new pool for a factory.
>   AttributePool(AttributeFactory &factory) : Factory(factory), Head(nullptr) {}
> 
> -  /// Move the given pool's allocations to this pool.
> -  AttributePool(AttributePool &pool) : Factory(pool.Factory), Head(pool.Head) {
> -    pool.Head = nullptr;
> -  }
> -

Moving without R-value references is weird, but it seems to me like
at least this was preventing double-ownership of the Head.

I'm pretty sure now that this function has been removed, the copy
constructor will be auto-generated.  Should you `= delete` it?

>   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



More information about the cfe-commits mailing list