From: Christopher Dykes Date: Wed, 16 Nov 2016 21:20:32 +0000 (-0800) Subject: Mark a few constexpr locals in ThreadLocalTest as static X-Git-Tag: v2016.11.21.00~26 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=77a350d28a77cfae6ef492cfcb9e2b30d05d0444;p=folly.git Mark a few constexpr locals in ThreadLocalTest as static Summary: Because, as discussed in past diffs, MSVC currently requires them to be static in order to resolve them from within the scope of a lambda when they aren't captured. The only one that actually needs to be marked as `static` is `numReps`, but I like consistency, so I marked them all as static. Reviewed By: yfeldblum Differential Revision: D4191610 fbshipit-source-id: 7246170f30551d2079b4373eefbf3d02aab6dfa9 --- diff --git a/folly/test/ThreadLocalTest.cpp b/folly/test/ThreadLocalTest.cpp index e333913e..db163e5f 100644 --- a/folly/test/ThreadLocalTest.cpp +++ b/folly/test/ThreadLocalTest.cpp @@ -416,11 +416,11 @@ class FillObject { #if FOLLY_HAVE_STD_THIS_THREAD_SLEEP_FOR TEST(ThreadLocal, Stress) { - constexpr size_t numFillObjects = 250; + static constexpr size_t numFillObjects = 250; std::array, numFillObjects> objects; - constexpr size_t numThreads = 32; - constexpr size_t numReps = 20; + static constexpr size_t numThreads = 32; + static constexpr size_t numReps = 20; std::vector threads; threads.reserve(numThreads);