From d456b584d94f9e5e48b01277d514999e0f461a7f Mon Sep 17 00:00:00 2001 From: Hannes Roth Date: Thu, 17 Apr 2014 08:49:51 -0700 Subject: [PATCH] (Folly/Gen) Fix compilation with clang Summary: Clang chokes because it tries to instantiate both versions of `from`, one of which calls `std::begin(const int*)`, which doesn't work. By casting the intializer list to the right type, it can pick the overload. Clang, because it makes debugging these templates so much better. Test Plan: `fbconfig --clang folly/gen/test && fbmake runtests_dbg` Reviewed By: tjackson@fb.com FB internal diff: D1280888 --- folly/gen/test/BaseTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/gen/test/BaseTest.cpp b/folly/gen/test/BaseTest.cpp index 6f58e732..06e50f37 100644 --- a/folly/gen/test/BaseTest.cpp +++ b/folly/gen/test/BaseTest.cpp @@ -882,7 +882,7 @@ TEST(Gen, Cycle) { TEST(Gen, Dereference) { { const int x = 4, y = 2; - auto s = from({&x, nullptr, &y}); + auto s = from(std::initializer_list({&x, nullptr, &y})); EXPECT_EQ(6, s | dereference | sum); } { -- 2.34.1