]> granicus.if.org Git - clang/commitdiff
Pass the filter function_ref by value now that r221753 fixes the bug
authorKaelyn Takata <rikka@google.com>
Wed, 12 Nov 2014 18:34:08 +0000 (18:34 +0000)
committerKaelyn Takata <rikka@google.com>
Wed, 12 Nov 2014 18:34:08 +0000 (18:34 +0000)
that was preventing pass-by-value from working correctly.

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

lib/Sema/SemaExprCXX.cpp

index 5b861ad54586a33924ab5a81d2d1303cca0cad4d..88eb41ac4484707f088605b8d4d6a65b26cddf12 100644 (file)
@@ -5989,8 +5989,8 @@ class TransformTypos : public TreeTransform<TransformTypos> {
   }
 
 public:
-  TransformTypos(Sema &SemaRef, llvm::function_ref<ExprResult(Expr *)> &&Filter)
-      : BaseTransform(SemaRef), ExprFilter(std::move(Filter)) {}
+  TransformTypos(Sema &SemaRef, llvm::function_ref<ExprResult(Expr *)> Filter)
+      : BaseTransform(SemaRef), ExprFilter(Filter) {}
 
   ExprResult RebuildCallExpr(Expr *Callee, SourceLocation LParenLoc,
                                    MultiExprArg Args,
@@ -6075,7 +6075,7 @@ ExprResult Sema::CorrectDelayedTyposInExpr(
       (E->isTypeDependent() || E->isValueDependent() ||
        E->isInstantiationDependent())) {
     auto TyposResolved = DelayedTypos.size();
-    auto Result = TransformTypos(*this, std::move(Filter)).Transform(E);
+    auto Result = TransformTypos(*this, Filter).Transform(E);
     TyposResolved -= DelayedTypos.size();
     if (TyposResolved) {
       ExprEvalContexts.back().NumTypos -= TyposResolved;