Commit e2d788ff authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Fix folly/gen/test/ParallelBenchmark.cpp under gcc8 with -Wshadow

Summary:
[Folly] Fix `folly/gen/test/ParallelBenchmark.cpp` under gcc8 with `-Wshadow`.

```
In file included from folly/gen/test/Bench.h:19,
                 from folly/gen/test/ParallelBenchmark.cpp:26:
folly/Benchmark.h: In instantiation of 'typename std::enable_if<std::is_invocable<Lambda, unsigned int>::value>::type folly::addBenchmark(const char*, const char*, Lambda&&) [with Lambda = <lambda(unsigned int)>; typename std::enable_if<std::is_invocable<Lambda, unsigned int>::value>::type = void]':
folly/gen/test/ParallelBenchmark.cpp:96:279:   required from here
folly/Benchmark.h:185:10: error: declaration of 'start' shadows a global declaration [-Werror=shadow]
folly/gen/test/ParallelBenchmark.cpp:83:6: note: shadowed declaration is here
```

Reviewed By: Orvid

Differential Revision: D13605092

fbshipit-source-id: ac791942edbfeda70809d4ab80d21bb3ff7dd8de
parent bb1efade
......@@ -38,6 +38,7 @@ size_t fib(int n) {
return n <= 1 ? 1 : fib(n - 1) + fib(n - 2);
}
namespace {
static auto isPrimeSlow = [](int n) {
if (n < 2) {
return false;
......@@ -87,6 +88,7 @@ auto medium = from(v) | take(1 << 14);
auto large = from(v) | take(1 << 18);
auto huge = from(v);
auto chunks = chunked(v);
} // namespace
BENCH_GEN(small | map(factorsSlow) | sum);
BENCH_GEN_REL(small | parallel(map(factorsSlow)) | sum);
......
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