Work around bug in initialization of std::array base class with older clangs

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289741 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2016-12-14 23:24:12 +00:00
parent bad1d6c248
commit c480bc55cd
2 changed files with 9 additions and 3 deletions

View File

@ -95,7 +95,9 @@ void do_derived_assign_test() {
}
reset();
{
DerivedFromTup<std::array<int, 2>> d = {{{42, 101}}};
DerivedFromTup<std::array<int, 2>> d;
d[0] = 42;
d[1] = 101;
t = ValueCategoryCast<VC>(d);
assert(std::get<0>(t) == 42);
assert(std::get<1>(t).checkAssign(101, VC));

View File

@ -103,7 +103,9 @@ void do_derived_construct_test() {
assert(std::get<1>(t).checkConstruct(101, VC));
}
{
DerivedFromTup<std::array<int, 2>> d = {{{42, 101}}};
DerivedFromTup<std::array<int, 2>> d;
d[0] = 42;
d[1] = 101;
Tup1 t = ValueCategoryCast<VC>(d);
assert(std::get<0>(t) == 42);
assert(std::get<1>(t).checkConstruct(101, VC));
@ -132,7 +134,9 @@ void do_derived_construct_test() {
using D = DerivedFromTup<std::array<int, 2>>;
static_assert(!std::is_convertible<ApplyValueCategoryT<VC, D>, Tup2>::value,
"");
D d = {{{42, 101}}};
D d;
d[0] = 42;
d[1] = 101;
Tup2 t(ValueCategoryCast<VC>(d));
assert(std::get<0>(t) == 42);
assert(std::get<1>(t).checkConstruct(101, VC));