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
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);
}
{