summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-04-18 23:26:47 +0000
committerEric Fiselier <eric@efcs.ca>2017-04-18 23:26:47 +0000
commitddda456a76b2809e818c82d90252f42511900b12 (patch)
tree2d0f023c7cdeba05b6bd8c89f9534585fb1dc8b3 /libcxx
parent918802bed47a6083c968406371e1b3f71ae95a74 (diff)
downloadbcm5719-llvm-ddda456a76b2809e818c82d90252f42511900b12.tar.gz
bcm5719-llvm-ddda456a76b2809e818c82d90252f42511900b12.zip
Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
llvm-svn: 300625
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/algorithm18
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp13
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp13
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp4
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp15
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp15
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp15
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp14
-rw-r--r--libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp14
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp7
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp9
-rw-r--r--libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp9
16 files changed, 72 insertions, 110 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 571edd26550..c3517a11bb0 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2548,7 +2548,7 @@ min(const _Tp& __a, const _Tp& __b)
return _VSTD::min(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2566,7 +2566,7 @@ min(initializer_list<_Tp> __t)
return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// max_element
@@ -2613,7 +2613,7 @@ max(const _Tp& __a, const _Tp& __b)
return _VSTD::max(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2631,7 +2631,7 @@ max(initializer_list<_Tp> __t)
return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
// clamp
@@ -2732,7 +2732,7 @@ minmax(const _Tp& __a, const _Tp& __b)
return _VSTD::minmax(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2779,7 +2779,7 @@ minmax(initializer_list<_Tp> __t)
return _VSTD::minmax(__t, __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// random_shuffle
@@ -2837,7 +2837,7 @@ private:
_Engine_result_type __mask0_;
_Engine_result_type __mask1_;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
+ _Working_result_type(1);
#else
@@ -3080,7 +3080,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
template <class _RandomAccessIterator, class _RandomNumberGenerator>
void
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_RandomNumberGenerator&& __rand)
#else
_RandomNumberGenerator& __rand)
@@ -3173,7 +3173,7 @@ _SampleIterator sample(_PopulationIterator __first,
template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_UniformRandomNumberGenerator&& __g)
#else
_UniformRandomNumberGenerator& __g)
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
index 9a954d934c4..0c1cc15445f 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
@@ -16,10 +16,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class InIter, class OutIter>
@@ -38,8 +37,7 @@ test()
assert(ia[i] == ib[i]);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
template <class InIter, class OutIter>
void
test1()
@@ -55,8 +53,7 @@ test1()
for (unsigned i = 0; i < N; ++i)
assert(*ib[i] == static_cast<int>(i));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
int main()
{
@@ -95,7 +92,7 @@ int main()
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test1<input_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
test1<input_iterator<std::unique_ptr<int>*>, input_iterator<std::unique_ptr<int>*> >();
test1<input_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
@@ -130,5 +127,5 @@ int main()
test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
index c5f9d3ac7b6..9b3df5af432 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
@@ -16,10 +16,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class InIter, class OutIter>
@@ -38,8 +37,7 @@ test()
assert(ia[i] == ib[i]);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
template <class InIter, class OutIter>
void
test1()
@@ -55,8 +53,7 @@ test1()
for (unsigned i = 0; i < N; ++i)
assert(*ib[i] == static_cast<int>(i));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
int main()
{
@@ -72,7 +69,7 @@ int main()
test<const int*, random_access_iterator<int*> >();
test<const int*, int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test1<bidirectional_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
@@ -84,5 +81,5 @@ int main()
test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
index 8eddfbc4d04..ce74684f3c9 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
@@ -17,9 +17,7 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#include <memory>
-#endif
+
#include "test_iterators.h"
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
index 80f86568c4d..a77a9eddb19 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
@@ -17,10 +17,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -39,8 +38,7 @@ test()
assert(ia[5] == 4);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
template <class Iter>
void
test1()
@@ -62,8 +60,7 @@ test1()
assert(*ia[4] == 3);
assert(*ia[5] == 4);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -72,12 +69,10 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
index b234431295a..c40f3e72783 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
@@ -18,10 +18,9 @@
#include <algorithm>
#include <functional>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
#include "counting_predicates.hpp"
@@ -46,8 +45,7 @@ test()
assert(cp.count() == sa);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
struct pred
{
bool operator()(const std::unique_ptr<int>& i) {return *i == 2;}
@@ -77,8 +75,7 @@ test1()
assert(*ia[4] == 3);
assert(*ia[5] == 4);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -87,12 +84,10 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
test1<forward_iterator<std::unique_ptr<int>*> >();
test1<bidirectional_iterator<std::unique_ptr<int>*> >();
test1<random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*>();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
index 64a5a6a5a06..84f2c8c9f11 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
@@ -16,10 +16,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template<class Iter1, class Iter2>
@@ -38,8 +37,7 @@ test()
assert(j[2] == 3);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
template<class Iter1, class Iter2>
void
test1()
@@ -59,8 +57,7 @@ test1()
assert(*j[1] == 2);
assert(*j[2] == 3);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
void test2()
{
@@ -131,8 +128,7 @@ int main()
test<int*, random_access_iterator<int*> >();
test<int*, int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
test1<forward_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
test1<forward_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
test1<forward_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
@@ -152,8 +148,7 @@ int main()
test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
test2();
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
index ab4ffad60f9..049ccfe9871 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
@@ -17,10 +17,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
@@ -84,7 +83,7 @@ test()
assert(ii[2] == 2);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
struct do_nothing
{
@@ -168,8 +167,7 @@ test1()
assert(*ii[1] == 1);
assert(*ii[2] == 2);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -178,12 +176,10 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
test1<forward_iterator<Ptr*> >();
test1<bidirectional_iterator<Ptr*> >();
test1<random_access_iterator<Ptr*> >();
test1<Ptr*>();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
index c6df235bed6..1640052058c 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
@@ -17,10 +17,9 @@
#include <algorithm>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
-#endif
+#include "test_macros.h"
#include "test_iterators.h"
struct count_equal
@@ -110,7 +109,7 @@ test()
assert(count_equal::count == si-1);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
struct do_nothing
{
@@ -210,8 +209,7 @@ test1()
assert(*ii[2] == 2);
assert(count_equal::count == si-1);
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // TEST_STD_VER >= 11
int main()
{
@@ -220,12 +218,10 @@ int main()
test<random_access_iterator<int*> >();
test<int*>();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#if TEST_STD_VER >= 11
test1<forward_iterator<Ptr*> >();
test1<bidirectional_iterator<Ptr*> >();
test1<random_access_iterator<Ptr*> >();
test1<Ptr*>();
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
index 8e7931f7ea5..33b8ff9ae43 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
@@ -18,9 +18,9 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
struct indirect_less
{
@@ -29,7 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
std::mt19937 randomness;
@@ -53,7 +52,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -68,5 +67,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
index 38d09ceda6e..1b1987aa920 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
@@ -19,9 +19,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -29,8 +30,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -51,7 +50,7 @@ int main()
{
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
}
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
index c0a05e4209b..02839abab33 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
@@ -18,9 +18,10 @@
#include <functional>
#include <random>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -28,8 +29,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void test(int N)
@@ -53,7 +52,7 @@ int main()
test(10);
test(1000);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
const int N = 1000;
std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -65,5 +64,5 @@ int main()
assert(std::is_sorted(ia, ia+N, indirect_less()));
delete [] ia;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
index 88249ed78d2..fa30797bd3f 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -78,7 +77,7 @@ int main()
test(1000);
test(1009);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -86,5 +85,5 @@ int main()
std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
assert(static_cast<std::size_t>(*v[v.size()/2]) == v.size()/2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
index 847a5829140..fb797671371 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
void
@@ -84,7 +83,7 @@ int main()
test_larger_sorts(1009);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -93,5 +92,5 @@ int main()
for (int i = 0; static_cast<std::size_t>(i) < v.size()/2; ++i)
assert(*v[i] == i);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
index c77015993c8..87d66c4723d 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
@@ -20,9 +20,10 @@
#include <vector>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -30,8 +31,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
int main()
{
{
@@ -43,7 +42,7 @@ int main()
assert(std::is_sorted(v.begin(), v.end()));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -54,5 +53,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
index 347711bf5e3..8306cc3b1b1 100644
--- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
@@ -21,9 +21,10 @@
#include <random>
#include <cassert>
#include <cstddef>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#include <memory>
+#include "test_macros.h"
+
struct indirect_less
{
template <class P>
@@ -31,8 +32,6 @@ struct indirect_less
{return *x < *y;}
};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
std::mt19937 randomness;
struct first_only
@@ -72,7 +71,7 @@ int main()
{
test();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
{
std::vector<std::unique_ptr<int> > v(1000);
for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -83,5 +82,5 @@ int main()
assert(*v[1] == 1);
assert(*v[2] == 2);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
}
OpenPOWER on IntegriCloud