From: Jim Meyering <meyering@fb.com>
Date: Wed, 19 Oct 2016 15:09:51 +0000 (-0700)
Subject: folly/futures/test/NonCopyableLambdaTest.cpp: avoid shadowing warnings
X-Git-Tag: v2016.10.24.00~13
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3aea6e3b26983d9b136e180431a7581955a04bf3;p=folly.git

folly/futures/test/NonCopyableLambdaTest.cpp: avoid shadowing warnings

Summary: Fix warnings exposed by the upstream-proposed -Wshadow-compatible-local option.

Reviewed By: markisaa

Differential Revision: D4041764

fbshipit-source-id: b2aa6543ce4bc36069b010f1107f1ac117073b26
---

diff --git a/folly/futures/test/NonCopyableLambdaTest.cpp b/folly/futures/test/NonCopyableLambdaTest.cpp
index b499400a..92f5c464 100644
--- a/folly/futures/test/NonCopyableLambdaTest.cpp
+++ b/folly/futures/test/NonCopyableLambdaTest.cpp
@@ -24,7 +24,7 @@ TEST(NonCopyableLambda, basic) {
   Future<int> future = promise.getFuture();
 
   Future<Unit>().then(std::bind(
-      [](Promise<int>& promise) mutable { promise.setValue(123); },
+      [](Promise<int>& p2) mutable { p2.setValue(123); },
       std::move(promise)));
 
   // The previous statement can be simplified in C++14:
@@ -43,9 +43,9 @@ TEST(NonCopyableLambda, unique_ptr) {
   EXPECT_EQ(*int_ptr, 1);
 
   auto future = promise.getFuture().then(std::bind(
-      [](std::unique_ptr<int>& int_ptr) mutable {
-        ++*int_ptr;
-        return std::move(int_ptr);
+      [](std::unique_ptr<int>& p) mutable {
+        ++*p;
+        return std::move(p);
       },
       std::move(int_ptr)));