diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:03:23 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:03:23 +0000 |
commit | 0dc0969cd0a732760f0aa79942a04e0eaef297c4 (patch) | |
tree | 051bdb57b1ac6ee143f61ddbb47bd0da619f6f0c /test/std/utilities/tuple/tuple.tuple | |
parent | 868847c6900e575417c03bced6e562b3af891318 (diff) |
Notes
Diffstat (limited to 'test/std/utilities/tuple/tuple.tuple')
5 files changed, 29 insertions, 8 deletions
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<Tp>(std::forward<Tuple>(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 <class T1, class T2, class U1, class U2> inline bool operator==(const std::pair<T1, T2>& lhs, const std::pair<U1, U2>& 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<int>; std::allocator<int> A; { // rvalue reference @@ -144,8 +144,8 @@ int main() assert(&std::get<0>(t2) == &t1); } // Test constructing a 1-tuple of the form tuple<UDT> from another 1-tuple - // 'tuple<T>' where UDT *can* be constructed from 'tuple<T>' In this case - // the 'tuple(UTypes...)' ctor should be choosen and 'UDT' constructed frow + // 'tuple<T>' where UDT *can* be constructed from 'tuple<T>'. In this case + // the 'tuple(UTypes...)' ctor should be chosen and 'UDT' constructed from // 'tuple<T>'. { 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 <tuple> #include <cassert> @@ -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<IllFormedDefault> 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<int&, decltype(std::ignore)&, double&>; + auto res = std::tie(i, std::ignore, f); + static_assert(std::is_same<ExpectT, decltype(res)>::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 } |