Commit 3aea6e3b authored by Jim Meyering's avatar Jim Meyering Committed by Facebook Github Bot

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
parent 9517f7b4
......@@ -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)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment