]> granicus.if.org Git - clang/commitdiff
Fix two clang-tidy misc-move-forwarding-reference warnings
authorMalcolm Parsons <malcolm.parsons@gmail.com>
Tue, 6 Dec 2016 14:49:18 +0000 (14:49 +0000)
committerMalcolm Parsons <malcolm.parsons@gmail.com>
Tue, 6 Dec 2016 14:49:18 +0000 (14:49 +0000)
Patch by Michael Sharpe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288813 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Type.cpp
lib/CodeGen/CGBlocks.cpp

index d98d8d72aeb859d08ce3335b4a3e25704474ad1d..0d0cd2e305be2e27ad017e63a5062a167449341a 100644 (file)
@@ -1057,7 +1057,7 @@ QualType simpleTransform(ASTContext &ctx, QualType type, F &&f) {
   SplitQualType splitType = type.split();
 
   // Visit the type itself.
-  SimpleTransformVisitor<F> visitor(ctx, std::move(f));
+  SimpleTransformVisitor<F> visitor(ctx, std::forward<F>(f));
   QualType result = visitor.Visit(splitType.Ty);
   if (result.isNull())
     return result;
index 09911d4b0999e88b28a85f5e77822c531804830a..50a6d61e7e53f995a556c876b42f2bb37e1083c0 100644 (file)
@@ -1941,7 +1941,7 @@ static T *buildByrefHelpers(CodeGenModule &CGM, const BlockByrefInfo &byrefInfo,
   generator.CopyHelper = buildByrefCopyHelper(CGM, byrefInfo, generator);
   generator.DisposeHelper = buildByrefDisposeHelper(CGM, byrefInfo, generator);
 
-  T *copy = new (CGM.getContext()) T(std::move(generator));
+  T *copy = new (CGM.getContext()) T(std::forward<T>(generator));
   CGM.ByrefHelpersCache.InsertNode(copy, insertPos);
   return copy;
 }