From 0dc0969cd0a732760f0aa79942a04e0eaef297c4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:03:23 +0000 Subject: Vendor import of libc++ trunk r300422: https://llvm.org/svn/llvm-project/libcxx/trunk@300422 --- .../tuple.apply/make_from_tuple.pass.cpp | 2 +- .../PR22806_constrain_tuple_like_ctor.pass.cpp | 6 +++--- .../tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp | 4 ++-- .../tuple/tuple.tuple/tuple.cnstr/default.pass.cpp | 4 ++-- .../tuple/tuple.tuple/tuple.creation/tie.pass.cpp | 21 +++++++++++++++++++++ 5 files changed, 29 insertions(+), 8 deletions(-) (limited to 'test/std/utilities/tuple/tuple.tuple') diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp index eee1dd88253c9..bd91ce61b4ec8 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp @@ -66,7 +66,7 @@ constexpr bool do_constexpr_test(Tuple&& tup) { return std::make_from_tuple(std::forward(tup)).args == tup; } -// Needed by do_forwarding_test() since it compare pairs of different types. +// Needed by do_forwarding_test() since it compares pairs of different types. template inline bool operator==(const std::pair& lhs, const std::pair& rhs) { return lhs.first == rhs.first && lhs.second == rhs.second; diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp index 4ddfb463385c7..0d3b7ff24edb1 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp @@ -89,7 +89,7 @@ int main() // when both #1 and #2 participate in partial ordering #2 will always // be chosen over #1. // See PR22806 and LWG issue #2549 for more information. - // (https://llvm.org/bugs/show_bug.cgi?id=22806) + // (https://bugs.llvm.org/show_bug.cgi?id=22806) using T = std::tuple; std::allocator A; { // rvalue reference @@ -144,8 +144,8 @@ int main() assert(&std::get<0>(t2) == &t1); } // Test constructing a 1-tuple of the form tuple from another 1-tuple - // 'tuple' where UDT *can* be constructed from 'tuple' In this case - // the 'tuple(UTypes...)' ctor should be choosen and 'UDT' constructed frow + // 'tuple' where UDT *can* be constructed from 'tuple'. In this case + // the 'tuple(UTypes...)' ctor should be chosen and 'UDT' constructed from // 'tuple'. { using VT = ConstructibleFromTupleAndInt; diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp index 4da5fc7f83979..b262f3cacecf7 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp @@ -18,7 +18,7 @@ // NOTE: this constructor does not currently support tags derived from // allocator_arg_t because libc++ has to deduce the parameter as a template -// argument. See PR27684 (https://llvm.org/bugs/show_bug.cgi?id=27684) +// argument. See PR27684 (https://bugs.llvm.org/show_bug.cgi?id=27684) #include #include @@ -96,7 +96,7 @@ int main() } { // Test that the uses-allocator default constructor does not evaluate - // it's SFINAE when it otherwise shouldn't be selected. Do this by + // its SFINAE when it otherwise shouldn't be selected. Do this by // using 'NonDefaultConstructible' which will cause a compile error // if std::is_default_constructible is evaluated on it. using T = NonDefaultConstructible<>; diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp index d282c9c68a42d..eeaa8a24ee68c 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp @@ -100,8 +100,8 @@ int main() assert(std::get<1>(t) == nullptr); } { - // Check that the SFINAE on the default constructor is not evaluted when - // it isn't needed. If the default constructor is evaluted then this test + // Check that the SFINAE on the default constructor is not evaluated when + // it isn't needed. If the default constructor is evaluated then this test // should fail to compile. IllFormedDefault v(0); std::tuple t(v); diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp index c4c3c242d8f82..5dc98afe66106 100644 --- a/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp +++ b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp @@ -22,6 +22,24 @@ #include "test_macros.h" +#if TEST_STD_VER > 11 +constexpr bool test_tie_constexpr() { + { + int i = 42; + double f = 1.1; + using ExpectT = std::tuple; + auto res = std::tie(i, std::ignore, f); + static_assert(std::is_same::value, ""); + assert(&std::get<0>(res) == &i); + assert(&std::get<1>(res) == &std::ignore); + assert(&std::get<2>(res) == &f); + // FIXME: If/when tuple gets constexpr assignment + //res = std::make_tuple(101, nullptr, -1.0); + } + return true; +} +#endif + int main() { { @@ -39,5 +57,8 @@ int main() static_assert ( std::get<0>(t) == 42, "" ); static_assert ( std::get<1>(t) == 1.1, "" ); } + { + static_assert(test_tie_constexpr(), ""); + } #endif } -- cgit v1.2.3