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:
@@ -193,4 +193,16 @@ int main()
|
||||
assert(!(t1 > t2));
|
||||
assert(!(t1 >= t2));
|
||||
}
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
{
|
||||
typedef std::tuple<char, int, double> T1;
|
||||
typedef std::tuple<double, char, int> T2;
|
||||
constexpr T1 t1(1, 2, 3);
|
||||
constexpr T2 t2(1, 2, 4);
|
||||
static_assert( (t1 < t2), "");
|
||||
static_assert( (t1 <= t2), "");
|
||||
static_assert(!(t1 > t2), "");
|
||||
static_assert(!(t1 >= t2), "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user