diff --git a/util/thread_local_test.cc b/util/thread_local_test.cc index 6506edcf5..7bf008193 100644 --- a/util/thread_local_test.cc +++ b/util/thread_local_test.cc @@ -461,12 +461,12 @@ TEST_F(ThreadLocalTest, Fold) { auto unref = [](void* ptr) { delete static_cast*>(ptr); }; - const int kNumThreads = 16; - const int kItersPerThread = 10; + static const int kNumThreads = 16; + static const int kItersPerThread = 10; port::Mutex mu; port::CondVar cv(&mu); Params params(&mu, &cv, nullptr, kNumThreads, unref); - auto func = [&](void* ptr) { + auto func = [](void* ptr) { auto& p = *static_cast(ptr); ASSERT_TRUE(p.tls1.Get() == nullptr); p.tls1.Reset(new std::atomic(0));