[libcxx] r271065 - Guard testing of tuple extensions to make tests portable
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Fri May 27 15:41:47 PDT 2016
Author: ericwf
Date: Fri May 27 17:41:45 2016
New Revision: 271065
URL: http://llvm.org/viewvc/llvm-project?rev=271065&view=rev
Log:
Guard testing of tuple extensions to make tests portable
Modified:
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp
libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp?rev=271065&r1=271064&r2=271065&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/UTypes.pass.cpp Fri May 27 17:41:45 2016
@@ -82,6 +82,8 @@ void test_default_constructible_extensio
MoveOnly, Tuple, MoveOnly, MoveOnly
>::value, "");
}
+ // testing extensions
+#ifdef _LIBCPP_VERSION
{
typedef std::tuple<MoveOnly, int> Tuple;
typedef std::tuple<MoveOnly, Tuple, MoveOnly, MoveOnly> NestedTuple;
@@ -96,6 +98,7 @@ void test_default_constructible_extensio
MoveOnly, Tuple, MoveOnly, MoveOnly
>::value, "");
}
+#endif
}
int main()
@@ -118,6 +121,7 @@ int main()
assert(std::get<2>(t) == 2);
}
// extensions
+#ifdef _LIBCPP_VERSION
{
std::tuple<MoveOnly, MoveOnly, MoveOnly> t(MoveOnly(0),
MoveOnly(1));
@@ -131,7 +135,8 @@ int main()
assert(std::get<1>(t) == MoveOnly());
assert(std::get<2>(t) == MoveOnly());
}
-#if _LIBCPP_STD_VER > 11
+#endif
+#if TEST_STD_VER > 11
{
constexpr std::tuple<Empty> t0{Empty()};
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp?rev=271065&r1=271064&r2=271065&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_copy.pass.cpp Fri May 27 17:41:45 2016
@@ -52,6 +52,8 @@ int main()
assert(alloc_last::allocator_constructed);
assert(std::get<0>(t) == 2);
}
+// testing extensions
+#ifdef _LIBCPP_VERSION
{
typedef std::tuple<alloc_first, alloc_last> T;
T t0(2, 3);
@@ -75,4 +77,5 @@ int main()
assert(std::get<1>(t) == 2);
assert(std::get<2>(t) == 3);
}
+#endif
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp?rev=271065&r1=271064&r2=271065&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp Fri May 27 17:41:45 2016
@@ -53,6 +53,8 @@ int main()
assert(alloc_last::allocator_constructed);
assert(std::get<0>(t) == 1);
}
+// testing extensions
+#ifdef _LIBCPP_VERSION
{
typedef std::tuple<MoveOnly, alloc_first> T;
T t0(0 ,1);
@@ -74,4 +76,5 @@ int main()
assert(std::get<1>(t) == 2);
assert(std::get<2>(t) == 3);
}
+#endif
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp?rev=271065&r1=271064&r2=271065&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.pass.cpp Fri May 27 17:41:45 2016
@@ -136,7 +136,8 @@ int main()
assert(std::get<2>(t) == 2);
assert(std::get<3>(t) == 3);
}
- // extensions
+// extensions
+#ifdef _LIBCPP_VERSION
{
std::tuple<int, char*, std::string> t(2);
assert(std::get<0>(t) == 2);
@@ -156,4 +157,5 @@ int main()
assert(std::get<2>(t) == "text");
assert(std::get<3>(t) == 0.0);
}
+#endif
}
Modified: libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp?rev=271065&r1=271064&r2=271065&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.utility.pass.cpp Fri May 27 17:41:45 2016
@@ -18,6 +18,7 @@
// LWG #2212 says that tuple_size and tuple_element must be
// available after including <utility>
+#include <cstddef>
#include <utility>
#include <type_traits>
More information about the cfe-commits
mailing list