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 10:00:10 PST 2015


Oh, this type has a user-defined dtor, so it's deprecated to use the
implicit copy ctor/assignment operator anyway - and I have the -Wdeprecated
flag on in my build (& keep the LLVM build clean of any warnings it shows).

At some point (would love help) we should just turn that on for everyone,
then we wouldn't have to worry about types like this -Wdeprecated -Werror
would catch them. I think last time I tried to turn it on there were some
things in library headers, perhaps (maybe in cxxabi?) that needed cleaning
up that I didn't have/build/see locally...

- Dave

On Wed, Dec 2, 2015 at 9:57 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> 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/f6dc19a5/attachment.html>


More information about the cfe-commits mailing list