r230417 - Make RedeclarableResult's ownership-transferring constructor be a move

David Blaikie dblaikie at gmail.com
Wed Feb 25 09:46:05 PST 2015


On Tue, Feb 24, 2015 at 5:11 PM, Richard Smith <richard-llvm at metafoo.co.uk>
wrote:

> Author: rsmith
> Date: Tue Feb 24 19:11:29 2015
> New Revision: 230417
>
> URL: http://llvm.org/viewvc/llvm-project?rev=230417&view=rev
> Log:
> Make RedeclarableResult's ownership-transferring constructor be a move
> constructor.
>
> Modified:
>     cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
>
> Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=230417&r1=230416&r2=230417&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
> +++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Tue Feb 24 19:11:29 2015
> @@ -127,16 +127,16 @@ namespace clang {
>        Decl *MergeWith;
>        mutable bool Owning;
>        Decl::Kind DeclKind;
> -
> +
>        void operator=(RedeclarableResult &) = delete;
>

Isn't this (well, the normal copy ctor and copy assignment operator)
already deleted by the presence of the move ctor?


(speaking of which... I/we/someone should really get around to making
" definition of implicit copy constructor/assignment operator for '%s' is
deprecated because it has a user-declared thing" a subflag of -Wdeprecated
and turning it on for LLVM (& probably at Google too)... )


> -
> +
>      public:
>        RedeclarableResult(ASTReader &Reader, GlobalDeclID FirstID,
>                           Decl *MergeWith, Decl::Kind DeclKind)
>          : Reader(Reader), FirstID(FirstID), MergeWith(MergeWith),
>            Owning(true), DeclKind(DeclKind) {}
>
> -      RedeclarableResult(const RedeclarableResult &Other)
> +      RedeclarableResult(RedeclarableResult &&Other)
>          : Reader(Other.Reader), FirstID(Other.FirstID),
>            MergeWith(Other.MergeWith), Owning(Other.Owning),
>            DeclKind(Other.DeclKind) {
> @@ -148,7 +148,7 @@ namespace clang {
>              Reader.PendingDeclChainsKnown.insert(FirstID).second)
>            Reader.PendingDeclChains.push_back(FirstID);
>        }
> -
> +
>        /// \brief Retrieve the first ID.
>        GlobalDeclID getFirstID() const { return FirstID; }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150225/f3a61d83/attachment.html>


More information about the cfe-commits mailing list