folly/futures/test/NonCopyableLambdaTest.cpp: avoid shadowing warnings
authorJim Meyering <meyering@fb.com>
Wed, 19 Oct 2016 15:09:51 +0000 (08:09 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 19 Oct 2016 15:23:45 +0000 (08:23 -0700)
Summary: Fix warnings exposed by the upstream-proposed -Wshadow-compatible-local option.

Reviewed By: markisaa

Differential Revision: D4041764

fbshipit-source-id: b2aa6543ce4bc36069b010f1107f1ac117073b26

folly/futures/test/NonCopyableLambdaTest.cpp

index b499400ac50268b8d7503e697000bfbb22c4d648..92f5c464d9f468d1346de4fb4a561dfbeb0e8078 100644 (file)
@@ -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)));