Summary:
[Folly] Fix Build: `folly` with `-Wmissing-braces`.
Construction of `std::array` with list-initialization for the contained C array requires double braces, per the standard.
Compilers accept it with single braces, but will reject it when `-Wmissing-braces` is passed.
Reviewed By: igorsugak, meyering
Differential Revision:
D4202629
fbshipit-source-id:
e5b87a655e7f25e6cddb931dda28b172c768f227
constexpr array_detail::return_type<D, TList...> make_array(TList&&... t) {
using value_type =
typename array_detail::return_type_helper<D, TList...>::type;
- return {static_cast<value_type>(std::forward<TList>(t))...};
+ return {{static_cast<value_type>(std::forward<TList>(t))...}};
}
} // !folly
// bulk_data, to be captured in the lambda passed to Future::then.
// This is meant to force that the lambda can't be stored inside
// the Future object.
- std::array<char, sizeof(detail::Core<int>)> bulk_data = {0};
+ std::array<char, sizeof(detail::Core<int>)> bulk_data = {{0}};
// suppress gcc warning about bulk_data not being used
EXPECT_EQ(bulk_data[0], 0);
}
TEST(RangeFunc, ConstexprStdArray) {
- static constexpr const std::array<int, 4> numArray = {3, 17, 1, 9};
+ static constexpr const std::array<int, 4> numArray = {{3, 17, 1, 9}};
constexpr const auto numArrayRange = range(numArray);
EXPECT_EQ(17, numArrayRange[1]);
constexpr const auto numArrayRangeSize = numArrayRange.size();