Commit d456b584 authored by Hannes Roth's avatar Hannes Roth Committed by Sara Golemon

(Folly/Gen) Fix compilation with clang

Summary:
Clang chokes because it tries to instantiate both versions of `from<const int*>`, 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
parent ec06f66c
......@@ -882,7 +882,7 @@ TEST(Gen, Cycle) {
TEST(Gen, Dereference) {
{
const int x = 4, y = 2;
auto s = from<const int*>({&x, nullptr, &y});
auto s = from(std::initializer_list<const int*>({&x, nullptr, &y}));
EXPECT_EQ(6, s | dereference | 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