From 75eff74803140f4e0d8713b7d55f8da70472b10b Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 22 Jul 2013 16:02:19 +0000 Subject: Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates. llvm-svn: 186834 --- .../tuple.tuple/tuple.creation/tuple_cat.pass.cpp | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp') diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp index 7cfc736fb79..b47842d419c 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp @@ -36,12 +36,38 @@ int main() { std::tuple<> t = std::tuple_cat(std::array()); } - { std::tuple t1(1); std::tuple t = std::tuple_cat(t1); assert(std::get<0>(t) == 1); } + +#if _LIBCPP_STD_VER > 11 + { + constexpr std::tuple<> t = std::tuple_cat(); + } + { + constexpr std::tuple<> t1; + constexpr std::tuple<> t2 = std::tuple_cat(t1); + } + { + constexpr std::tuple<> t = std::tuple_cat(std::tuple<>()); + } + { + constexpr std::tuple<> t = std::tuple_cat(std::array()); + } + { + constexpr std::tuple t1(1); + constexpr std::tuple t = std::tuple_cat(t1); + static_assert(std::get<0>(t) == 1, ""); + } + { + constexpr std::tuple t1(1); + constexpr std::tuple t = std::tuple_cat(t1, t1); + static_assert(std::get<0>(t) == 1, ""); + static_assert(std::get<1>(t) == 1, ""); + } +#endif { std::tuple t = std::tuple_cat(std::tuple(1, 2)); -- cgit v1.2.3