summaryrefslogtreecommitdiffstats
path: root/test/std/utilities/tuple/tuple.tuple
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/utilities/tuple/tuple.tuple')
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp2
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.pass.cpp4
-rw-r--r--test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp21
4 files changed, 25 insertions, 4 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 eee1dd882..bd91ce61b 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 02f066b64..0d3b7ff24 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
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 4da5fc7f8..b262f3cac 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.creation/tie.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp
index c4c3c242d..5dc98afe6 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
}