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.

llvm-svn: 288813

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

index d98d8d7..0d0cd2e 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 09911d4..50a6d61 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;
 }