Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,4 +27,16 @@ int main()
|
||||
assert(std::get<0>(t1) == 2);
|
||||
assert(std::get<1>(t1) == short('a'));
|
||||
}
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
{
|
||||
typedef std::pair<double, char> P0;
|
||||
typedef std::tuple<int, short> T1;
|
||||
constexpr P0 p0(2.5, 'a');
|
||||
constexpr T1 t1 = p0;
|
||||
static_assert(std::get<0>(t1) != std::get<0>(p0), "");
|
||||
static_assert(std::get<1>(t1) == std::get<1>(p0), "");
|
||||
static_assert(std::get<0>(t1) == 2, "");
|
||||
static_assert(std::get<1>(t1) == short('a'), "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user