From 7a20ff9cc5af1f4321e267b47b90ba528ae42f0b Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Wed, 16 Nov 2016 16:41:51 -0800 Subject: [PATCH] Adjust the Function::NonCopyableLambda test to use a large struct rather than a C Array Summary: Because MSVC doesn't like it when you attempt to explicitly capture a c-style array in a lambda capture list. See: https://developercommunity.visualstudio.com/content/problem/2444/cannot-explicitly-capture-c-style-array-in-lambda.html Reviewed By: yfeldblum Differential Revision: D4191400 fbshipit-source-id: 305f8086c29f079ccf2c322f20da6393235bc76d --- folly/test/FunctionTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/test/FunctionTest.cpp b/folly/test/FunctionTest.cpp index 99c5b6c5..6e49c614 100644 --- a/folly/test/FunctionTest.cpp +++ b/folly/test/FunctionTest.cpp @@ -197,8 +197,10 @@ TEST(Function, NonCopyableLambda) { auto unique_ptr_int = folly::make_unique(900); EXPECT_EQ(900, *unique_ptr_int); - char fooData[64] = {0}; - EXPECT_EQ(0, fooData[0]); // suppress gcc warning about fooData not being used + struct { + char data[64]; + } fooData = {{0}}; + (void)fooData; // suppress gcc warning about fooData not being used auto functor = std::bind( [fooData](std::unique_ptr& up) mutable { return ++*up; }, -- 2.34.1