diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:21:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-20 21:21:10 +0000 |
commit | 1c3313bd0215c89fb38710a1ea0762ccf32e859c (patch) | |
tree | 65e6d33ca6254b41a8f4230edff47c5344dbd019 /test/std | |
parent | 0dc0969cd0a732760f0aa79942a04e0eaef297c4 (diff) | |
download | src-1c3313bd0215c89fb38710a1ea0762ccf32e859c.tar.gz src-1c3313bd0215c89fb38710a1ea0762ccf32e859c.zip |
Vendor import of libc++ trunk r300890:vendor/libc++/libc++-trunk-r300890
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=317224
svn path=/vendor/libc++/libc++-trunk-r300890/; revision=317225; tag=vendor/libc++/libc++-trunk-r300890
Diffstat (limited to 'test/std')
262 files changed, 989 insertions, 1153 deletions
diff --git a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp index 9a954d934c4e..0c1cc15445f7 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp index c5f9d3ac7b6b..9b3df5af4324 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp index 8eddfbc4d048..ce74684f3c96 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp index 80f86568c4d9..a77a9eddb191 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp index b234431295a4..c40f3e727836 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp index 64a5a6a5a064..84f2c8c9f11d 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp index ab4ffad60f9e..049ccfe9871a 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp +++ b/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/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp index c6df235bed6d..1640052058c7 100644 --- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp index 8e7931f7ea5d..33b8ff9ae43c 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp index 38d09ceda6e2..1b1987aa9205 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp index c0a05e4209b3..02839abab337 100644 --- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp index 88249ed78d27..fa30797bd3f9 100644 --- a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp index 847a5829140a..fb7976713719 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp index c77015993c8c..87d66c4723d1 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp +++ b/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/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp index 347711bf5e3a..8306cc3b1b12 100644 --- a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp +++ b/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 } diff --git a/test/std/containers/Emplaceable.h b/test/std/containers/Emplaceable.h index 34dd326203b0..f9319d410d2b 100644 --- a/test/std/containers/Emplaceable.h +++ b/test/std/containers/Emplaceable.h @@ -10,7 +10,10 @@ #ifndef EMPLACEABLE_H #define EMPLACEABLE_H -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#include <utility> +#include "test_macros.h" + +#if TEST_STD_VER >= 11 class Emplaceable { @@ -49,6 +52,5 @@ struct hash<Emplaceable> } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#endif // TEST_STD_VER >= 11 #endif // EMPLACEABLE_H diff --git a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp index f8fc21f1f2f5..8d27eabdf6a6 100644 --- a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp +++ b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -17,17 +19,13 @@ #include <map> -#ifndef _LIBCPP_HAS_NO_VARIADICS #include <tuple> -#endif int main() { -#ifndef _LIBCPP_HAS_NO_VARIADICS using namespace std; map<tuple<int,int>, size_t> m; m[make_tuple(2,3)]=7; -#endif } diff --git a/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp index 679600662fda..354911b76071 100644 --- a/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp +++ b/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::pair<const int, double> V; std::map<int, double> m = @@ -45,7 +46,6 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#if TEST_STD_VER >= 11 { typedef std::pair<const int, double> V; std::map<int, double, std::less<int>, min_allocator<V>> m = @@ -70,6 +70,4 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp index c55d18f54094..0504b1adc22e 100644 --- a/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp +++ b/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::pair<const int, double> V; std::map<int, double> m = @@ -41,7 +42,6 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#if TEST_STD_VER >= 11 { typedef std::pair<const int, double> V; std::map<int, double, std::less<int>, min_allocator<V>> m = @@ -62,6 +62,4 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp index 3133eb2e0dd6..d9c1fb89854b 100644 --- a/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp +++ b/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::pair<const int, double> V; typedef test_compare<std::less<int> > C; @@ -42,7 +43,6 @@ int main() assert(*next(m.begin(), 2) == V(3, 1)); assert(m.key_comp() == C(3)); } -#if TEST_STD_VER >= 11 { typedef std::pair<const int, double> V; typedef test_compare<std::less<int> > C; @@ -64,6 +64,4 @@ int main() assert(*next(m.begin(), 2) == V(3, 1)); assert(m.key_comp() == C(3)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp index d7552b3608eb..70783e625770 100644 --- a/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp +++ b/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::pair<const int, double> V; typedef test_compare<std::less<int> > C; @@ -45,7 +46,6 @@ int main() assert(m.key_comp() == C(3)); assert(m.get_allocator() == A(6)); } -#if TEST_STD_VER >= 11 { typedef std::pair<const int, double> V; typedef test_compare<std::less<int> > C; @@ -69,7 +69,6 @@ int main() assert(m.key_comp() == C(3)); assert(m.get_allocator() == A()); } -#if TEST_STD_VER > 11 { typedef std::pair<const int, double> V; typedef min_allocator<V> A; @@ -94,7 +93,6 @@ int main() assert(*next(m.begin(), 2) == V(3, 1)); assert(m.get_allocator() == a); } -#endif { typedef std::pair<const int, double> V; typedef explicit_allocator<V> A; @@ -119,6 +117,4 @@ int main() assert(m.key_comp() == C(3)); assert(m.get_allocator() == a); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/map/map.cons/move.pass.cpp b/test/std/containers/associative/map/map.cons/move.pass.cpp index 2d19b88bdda8..dd68f9c39ec8 100644 --- a/test/std/containers/associative/map/map.cons/move.pass.cpp +++ b/test/std/containers/associative/map/map.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES typedef std::pair<const int, double> V; { typedef test_compare<std::less<int> > C; @@ -69,7 +70,6 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#if TEST_STD_VER >= 11 { typedef test_compare<std::less<int> > C; typedef min_allocator<V> A; @@ -115,6 +115,4 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp index 8349f13fdebf..5f7ab8ece9f1 100644 --- a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -189,7 +190,6 @@ int main() } assert(Counter_base::gConstructed == 0); } -#if TEST_STD_VER >= 11 { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -268,6 +268,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/map/map.cons/move_assign.pass.cpp b/test/std/containers/associative/map/map.cons/move_assign.pass.cpp index 09b41d3b130b..8c0ef6e9a5c4 100644 --- a/test/std/containers/associative/map/map.cons/move_assign.pass.cpp +++ b/test/std/containers/associative/map/map.cons/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -144,7 +145,6 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#if TEST_STD_VER >= 11 { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -185,6 +185,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp b/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp index 63d014fe8cc5..3b595fc73d7c 100644 --- a/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp +++ b/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::map<int, DefaultOnly> M; typedef std::pair<M::iterator, bool> R; @@ -92,7 +93,6 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#if TEST_STD_VER >= 11 { typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef std::pair<M::iterator, bool> R; @@ -160,6 +160,4 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp b/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp index 319a239525ad..7236276a29a4 100644 --- a/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp +++ b/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::map<int, DefaultOnly> M; typedef M::iterator R; @@ -89,7 +90,6 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#if TEST_STD_VER >= 11 { typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef M::iterator R; @@ -155,6 +155,4 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp b/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp index 9cf3f3dcf74f..de8191a6bb60 100644 --- a/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp +++ b/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class map @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::pair<const int, double> V; std::map<int, double> m = @@ -43,7 +44,6 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#if TEST_STD_VER >= 11 { typedef std::pair<const int, double> V; std::map<int, double, std::less<int>, min_allocator<V>> m = @@ -66,6 +66,4 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp index 4c0326d90fe6..ae4ab349d234 100644 --- a/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multimap<int, double> C; typedef C::value_type V; @@ -50,7 +51,6 @@ int main() assert(*++i == V(3, 1.5)); assert(*++i == V(3, 2)); } -#if TEST_STD_VER >= 11 { typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef C::value_type V; @@ -80,6 +80,4 @@ int main() assert(*++i == V(3, 1.5)); assert(*++i == V(3, 2)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp index 6f645b63b44c..54b948c3e551 100644 --- a/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multimap<int, double> C; typedef C::value_type V; @@ -49,7 +50,6 @@ int main() assert(*++i == V(3, 1.5)); assert(*++i == V(3, 2)); } -#if TEST_STD_VER >= 11 { typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef C::value_type V; @@ -78,6 +78,4 @@ int main() assert(*++i == V(3, 1.5)); assert(*++i == V(3, 2)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp index 6d20d14f4200..a78e1889ac9e 100644 --- a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_compare<std::less<int> > Cmp; typedef std::multimap<int, double, Cmp> C; @@ -53,7 +54,6 @@ int main() assert(*++i == V(3, 2)); assert(m.key_comp() == Cmp(4)); } -#if TEST_STD_VER >= 11 { typedef test_compare<std::less<int> > Cmp; typedef std::multimap<int, double, Cmp, min_allocator<std::pair<const int, double>>> C; @@ -86,6 +86,4 @@ int main() assert(*++i == V(3, 2)); assert(m.key_comp() == Cmp(4)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp index 8d12a059b89d..ba6f76e52d65 100644 --- a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_compare<std::less<int> > Cmp; typedef test_allocator<std::pair<const int, double> > A; @@ -56,8 +57,6 @@ int main() assert(m.key_comp() == Cmp(4)); assert(m.get_allocator() == A(5)); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#if TEST_STD_VER >= 11 { typedef test_compare<std::less<int> > Cmp; typedef min_allocator<std::pair<const int, double> > A; @@ -92,7 +91,6 @@ int main() assert(m.key_comp() == Cmp(4)); assert(m.get_allocator() == A()); } -#if TEST_STD_VER > 11 { typedef test_compare<std::less<int> > C; typedef std::pair<const int, double> V; @@ -124,7 +122,6 @@ int main() assert(*++i == V(3, 2)); assert(m.get_allocator() == a); } -#endif { typedef test_compare<std::less<int> > Cmp; typedef explicit_allocator<std::pair<const int, double> > A; @@ -159,5 +156,4 @@ int main() assert(m.key_comp() == Cmp(4)); assert(m.get_allocator() == A{}); } -#endif } diff --git a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp index 7edec77365d8..769c709cf203 100644 --- a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES typedef std::pair<const int, double> V; { typedef test_compare<std::less<int> > C; @@ -75,7 +76,6 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#if TEST_STD_VER >= 11 { typedef test_compare<std::less<int> > C; typedef min_allocator<V> A; @@ -127,6 +127,4 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp index 6ce7127ea7cf..5882283abe3e 100644 --- a/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -189,7 +190,6 @@ int main() } assert(Counter_base::gConstructed == 0); } -#if TEST_STD_VER >= 11 { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -268,6 +268,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp index 924e9ddf1936..24742541571a 100644 --- a/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -144,7 +145,6 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#if TEST_STD_VER >= 11 { typedef std::pair<MoveOnly, MoveOnly> V; typedef std::pair<const MoveOnly, MoveOnly> VC; @@ -185,6 +185,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp index 7f5b698fa068..024cc670e814 100644 --- a/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multimap<int, DefaultOnly> M; typedef M::iterator R; @@ -84,7 +85,6 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#if TEST_STD_VER >= 11 { typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef M::iterator R; @@ -145,6 +145,4 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp index a6ed318c7598..d5fde83a7b65 100644 --- a/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multimap<int, DefaultOnly> M; typedef M::iterator R; @@ -89,7 +90,6 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#if TEST_STD_VER >= 11 { typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M; typedef M::iterator R; @@ -155,6 +155,4 @@ int main() assert(m.begin()->first == 2); assert(m.begin()->second == 3.5); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp index 89befb3e9971..20e0ba17ef42 100644 --- a/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp +++ b/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // class multimap @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multimap<int, double> C; typedef C::value_type V; @@ -53,7 +54,6 @@ int main() assert(*++i == V(3, 2)); assert(*++i == V(3, 1.5)); } -#if TEST_STD_VER >= 11 { typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C; typedef C::value_type V; @@ -86,6 +86,4 @@ int main() assert(*++i == V(3, 2)); assert(*++i == V(3, 1.5)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multiset/emplace.pass.cpp b/test/std/containers/associative/multiset/emplace.pass.cpp index 93842a250f8e..7e2628db0daa 100644 --- a/test/std/containers/associative/multiset/emplace.pass.cpp +++ b/test/std/containers/associative/multiset/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multiset<DefaultOnly> M; typedef M::iterator R; @@ -68,7 +69,6 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> M; typedef M::iterator R; @@ -78,6 +78,4 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multiset/emplace_hint.pass.cpp b/test/std/containers/associative/multiset/emplace_hint.pass.cpp index 48519fd4356a..2b9b92d0bf0a 100644 --- a/test/std/containers/associative/multiset/emplace_hint.pass.cpp +++ b/test/std/containers/associative/multiset/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multiset<DefaultOnly> M; typedef M::iterator R; @@ -68,7 +69,6 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> M; typedef M::iterator R; @@ -78,6 +78,4 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp index 590c66801f99..23a65a3ccf54 100644 --- a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp +++ b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multiset<int> C; typedef C::value_type V; @@ -39,8 +40,6 @@ int main() assert(*++i == V(8)); assert(*++i == V(10)); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -58,5 +57,4 @@ int main() assert(*++i == V(8)); assert(*++i == V(10)); } -#endif } diff --git a/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp b/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp index 0afc8dc87c23..f39fca5c8f38 100644 --- a/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp +++ b/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multiset<MoveOnly> M; typedef M::iterator R; @@ -46,8 +47,6 @@ int main() assert(m.size() == 4); assert(*r == 3); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::multiset<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M; typedef M::iterator R; @@ -72,5 +71,4 @@ int main() assert(m.size() == 4); assert(*r == 3); } -#endif } diff --git a/test/std/containers/associative/multiset/insert_rv.pass.cpp b/test/std/containers/associative/multiset/insert_rv.pass.cpp index 3ee464bc5bc7..68d348793c45 100644 --- a/test/std/containers/associative/multiset/insert_rv.pass.cpp +++ b/test/std/containers/associative/multiset/insert_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::multiset<MoveOnly> M; typedef M::iterator R; @@ -46,8 +47,6 @@ int main() assert(m.size() == 4); assert(*r == 3); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::multiset<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M; typedef M::iterator R; @@ -72,5 +71,4 @@ int main() assert(m.size() == 4); assert(*r == 3); } -#endif } diff --git a/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp index 2c5318afd73b..915a15fc65ac 100644 --- a/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multiset<int> C; typedef C::value_type V; @@ -36,8 +37,6 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -53,5 +52,4 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#endif } diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp index b3d6066ebeb3..f3ee002dc5f4 100644 --- a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::multiset<int> C; typedef C::value_type V; @@ -36,8 +37,6 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#if TEST_STD_VER >= 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -52,7 +51,6 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#if TEST_STD_VER > 11 { typedef std::multiset<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -69,6 +67,4 @@ int main() assert(*++i == V(6)); assert(m.get_allocator() == a); } -#endif -#endif } diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp index c67657aff8ac..3312ca1383ef 100644 --- a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS typedef test_compare<std::less<int> > Cmp; typedef std::multiset<int, Cmp> C; typedef C::value_type V; @@ -34,5 +35,4 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); assert(m.key_comp() == Cmp(10)); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp index 83114893a1b2..e495fce1396c 100644 --- a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS typedef test_compare<std::less<int> > Cmp; typedef test_allocator<int> A; typedef std::multiset<int, Cmp, A> C; @@ -37,5 +38,4 @@ int main() assert(*++i == V(6)); assert(m.key_comp() == Cmp(10)); assert(m.get_allocator() == A(4)); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp index 5a905cf15a08..2adfb5c37a4f 100644 --- a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int V; typedef test_compare<std::less<int> > C; @@ -76,8 +77,6 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef int V; V ar[] = @@ -115,5 +114,4 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#endif } diff --git a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp index 3da3fc09a45f..29797c3ee6be 100644 --- a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -183,5 +184,4 @@ int main() } assert(Counter_base::gConstructed == 0); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp index b0ec4f39451c..e767ff1a47f5 100644 --- a/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class multiset @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -141,8 +142,6 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -182,5 +181,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif } diff --git a/test/std/containers/associative/set/emplace.pass.cpp b/test/std/containers/associative/set/emplace.pass.cpp index 47ef455a996b..5d50a2435fa8 100644 --- a/test/std/containers/associative/set/emplace.pass.cpp +++ b/test/std/containers/associative/set/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::set<DefaultOnly> M; typedef std::pair<M::iterator, bool> R; @@ -74,7 +75,6 @@ int main() assert(m.size() == 1); assert(*r.first == 2); } -#if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> M; typedef std::pair<M::iterator, bool> R; @@ -85,6 +85,4 @@ int main() assert(m.size() == 1); assert(*r.first == 2); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/emplace_hint.pass.cpp b/test/std/containers/associative/set/emplace_hint.pass.cpp index 036f4d6dfb68..8962c0cbd7ab 100644 --- a/test/std/containers/associative/set/emplace_hint.pass.cpp +++ b/test/std/containers/associative/set/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::set<DefaultOnly> M; typedef M::iterator R; @@ -68,7 +69,6 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> M; typedef M::iterator R; @@ -78,6 +78,4 @@ int main() assert(m.size() == 1); assert(*r == 2); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/insert_initializer_list.pass.cpp b/test/std/containers/associative/set/insert_initializer_list.pass.cpp index 490d75905adc..3114d48abd40 100644 --- a/test/std/containers/associative/set/insert_initializer_list.pass.cpp +++ b/test/std/containers/associative/set/insert_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::set<int> C; typedef C::value_type V; @@ -39,7 +40,6 @@ int main() assert(*++i == V(8)); assert(*++i == V(10)); } -#if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -57,6 +57,4 @@ int main() assert(*++i == V(8)); assert(*++i == V(10)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/set/insert_iter_rv.pass.cpp b/test/std/containers/associative/set/insert_iter_rv.pass.cpp index be827d644d26..9579988c0899 100644 --- a/test/std/containers/associative/set/insert_iter_rv.pass.cpp +++ b/test/std/containers/associative/set/insert_iter_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::set<MoveOnly> M; typedef M::iterator R; @@ -46,7 +47,6 @@ int main() assert(m.size() == 3); assert(*r == 3); } -#if TEST_STD_VER >= 11 { typedef std::set<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M; typedef M::iterator R; @@ -71,6 +71,4 @@ int main() assert(m.size() == 3); assert(*r == 3); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/insert_rv.pass.cpp b/test/std/containers/associative/set/insert_rv.pass.cpp index e528ef347b88..25cbfcb882cd 100644 --- a/test/std/containers/associative/set/insert_rv.pass.cpp +++ b/test/std/containers/associative/set/insert_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::set<MoveOnly> M; typedef std::pair<M::iterator, bool> R; @@ -50,7 +51,6 @@ int main() assert(m.size() == 3); assert(*r.first == 3); } -#if TEST_STD_VER >= 11 { typedef std::set<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M; typedef std::pair<M::iterator, bool> R; @@ -79,6 +79,4 @@ int main() assert(m.size() == 3); assert(*r.first == 3); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp index 70e174a59612..9906a1c0b64d 100644 --- a/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp +++ b/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::set<int> C; typedef C::value_type V; @@ -36,7 +37,6 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -52,6 +52,4 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp index 5bb5460ddc0d..31521b2f3856 100644 --- a/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp +++ b/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::set<int> C; typedef C::value_type V; @@ -35,7 +36,6 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#if TEST_STD_VER >= 11 { typedef std::set<int, std::less<int>, min_allocator<int>> C; typedef C::value_type V; @@ -50,6 +50,4 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp index a0afa02cf749..ea72b6dc0260 100644 --- a/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp +++ b/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS typedef test_compare<std::less<int> > Cmp; typedef std::set<int, Cmp> C; typedef C::value_type V; @@ -34,5 +35,4 @@ int main() assert(*++i == V(5)); assert(*++i == V(6)); assert(m.key_comp() == Cmp(10)); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp index 80d41b0b5df7..f6cb734c3c29 100644 --- a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp +++ b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_compare<std::less<int> > Cmp; typedef test_allocator<int> A; @@ -41,7 +42,6 @@ int main() assert(m.key_comp() == Cmp(10)); assert(m.get_allocator() == A(4)); } -#if TEST_STD_VER > 11 { typedef test_compare<std::less<int> > Cmp; typedef test_allocator<int> A; @@ -59,6 +59,4 @@ int main() assert(*++i == V(6)); assert(m.get_allocator() == A(4)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/associative/set/set.cons/move.pass.cpp b/test/std/containers/associative/set/set.cons/move.pass.cpp index c836d4550203..dd313e4cd5e3 100644 --- a/test/std/containers/associative/set/set.cons/move.pass.cpp +++ b/test/std/containers/associative/set/set.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int V; typedef test_compare<std::less<int> > C; @@ -70,7 +71,6 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#if TEST_STD_VER >= 11 { typedef int V; V ar[] = @@ -102,6 +102,4 @@ int main() assert(mo.size() == 0); assert(distance(mo.begin(), mo.end()) == 0); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp index ba2adf5bb520..9e1cd816b116 100644 --- a/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp +++ b/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -184,5 +185,4 @@ int main() assert(Counter_base::gConstructed == 0); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/associative/set/set.cons/move_assign.pass.cpp b/test/std/containers/associative/set/set.cons/move_assign.pass.cpp index 07cb4153fa4a..7862f7bf7ebc 100644 --- a/test/std/containers/associative/set/set.cons/move_assign.pass.cpp +++ b/test/std/containers/associative/set/set.cons/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // class set @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -141,7 +142,6 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#if TEST_STD_VER >= 11 { typedef MoveOnly V; typedef test_compare<std::less<MoveOnly> > C; @@ -181,6 +181,4 @@ int main() assert(m3.key_comp() == C(5)); assert(m1.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp index b102f117d48f..6210a59c3abe 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp @@ -15,6 +15,7 @@ #include <queue> #include <cassert> +#include "test_macros.h" #include "test_allocator.h" template <class T> @@ -30,11 +31,11 @@ struct test : base(comp, c, a) {} test(const value_compare& comp, const container_type& c, const test_allocator<int>& a) : base(comp, c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(const value_compare& comp, container_type&& c, const test_allocator<int>& a) : base(comp, std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} using base::c; diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp index 4d99fc14728b..b1d13fb8b9f7 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp @@ -15,6 +15,7 @@ #include <queue> #include <cassert> +#include "test_macros.h" #include "test_allocator.h" template <class T> @@ -30,11 +31,11 @@ struct test : base(comp, a) {} test(const value_compare& comp, const container_type& c, const test_allocator<int>& a) : base(comp, c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(const value_compare& comp, container_type&& c, const test_allocator<int>& a) : base(comp, std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} using base::c; diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp index 8bdf7db863e7..df255b4cf12a 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // template <class Alloc> @@ -17,7 +19,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -52,11 +53,9 @@ struct test using base::c; }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES test<MoveOnly> qo(std::less<MoveOnly>(), make<std::vector<MoveOnly, test_allocator<MoveOnly> > >(5), test_allocator<MoveOnly>(2)); @@ -64,5 +63,4 @@ int main() assert(q.size() == 5); assert(q.c.get_allocator() == test_allocator<MoveOnly>(6)); assert(q.top() == MoveOnly(4)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp index d43e53819975..4b20b265ff34 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue& operator=(priority_queue&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,15 +29,12 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::priority_queue<MoveOnly> qo(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5)); std::priority_queue<MoveOnly> q; q = std::move(qo); assert(q.size() == 5); assert(q.top() == MoveOnly(4)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp index b61fb88a5a36..719f6d98078f 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // explicit priority_queue(const Compare& comp, container_type&& c); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,13 +29,10 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::priority_queue<MoveOnly> q(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5)); assert(q.size() == 5); assert(q.top() == MoveOnly(4)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp index 7abe796e53ef..450dff37c52f 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // template <class InputIterator> @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES int a[] = {3, 5, 2, 0, 6, 8, 1}; const int n = sizeof(a)/sizeof(a[0]); std::priority_queue<MoveOnly> q(a+n/2, a+n, @@ -28,5 +29,4 @@ int main() std::vector<MoveOnly>(a, a+n/2)); assert(q.size() == n); assert(q.top() == MoveOnly(8)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp index aac8403e5922..229ec02fcea1 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue(priority_queue&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,14 +29,11 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::priority_queue<MoveOnly> qo(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5)); std::priority_queue<MoveOnly> q = std::move(qo); assert(q.size() == 5); assert(q.top() == MoveOnly(4)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp index 5dec2b910fb7..e0547d64a014 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue() @@ -15,7 +17,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 #include <queue> #include <cassert> @@ -30,5 +31,5 @@ int main() typedef std::priority_queue<MoveOnly> C; static_assert(std::is_nothrow_default_constructible<C>::value, ""); } -#endif // _LIBCPP_VERSION +#endif } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp index 0218992670f2..9c2058d47877 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue(priority_queue&&) @@ -15,8 +17,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 - #include <queue> #include <cassert> diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp index 4f14e93f5f52..be928fc2ea4c 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue(); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::priority_queue<Emplaceable> q; q.emplace(1, 2.5); assert(q.top() == Emplaceable(1, 2.5)); @@ -28,5 +29,4 @@ int main() assert(q.top() == Emplaceable(3, 4.5)); q.emplace(2, 3.5); assert(q.top() == Emplaceable(3, 4.5)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp index 4b20a9bf905f..7f48272679b1 100644 --- a/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp +++ b/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // priority_queue(); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::priority_queue<MoveOnly> q; q.push(1); assert(q.top() == 1); @@ -28,5 +29,4 @@ int main() assert(q.top() == 3); q.push(2); assert(q.top() == 3); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp index b3ee758182a5..404db124080b 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp @@ -15,6 +15,7 @@ #include <queue> #include <cassert> +#include "test_macros.h" #include "test_allocator.h" struct test @@ -24,10 +25,10 @@ struct test explicit test(const test_allocator<int>& a) : base(a) {} test(const container_type& c, const test_allocator<int>& a) : base(c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} }; diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp index e4fff91f07c7..06a53fe385d9 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp @@ -16,6 +16,7 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_allocator.h" template <class C> @@ -37,10 +38,10 @@ struct test explicit test(const test_allocator<int>& a) : base(a) {} test(const container_type& c, const test_allocator<int>& a) : base(c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} }; diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp index 0163588efa50..243585693739 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // template <class Alloc> @@ -18,7 +20,6 @@ #include "test_allocator.h" #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -47,13 +48,10 @@ struct test allocator_type get_allocator() {return this->c.get_allocator();} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4)); assert(q.get_allocator() == test_allocator<MoveOnly>(4)); assert(q.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp index 7237bf271b0c..76428e33fb27 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // template <class Alloc> @@ -18,7 +20,6 @@ #include "test_allocator.h" #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -47,14 +48,11 @@ struct test allocator_type get_allocator() {return this->c.get_allocator();} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4)); test<MoveOnly> q2(std::move(q), test_allocator<MoveOnly>(5)); assert(q2.get_allocator() == test_allocator<MoveOnly>(5)); assert(q2.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp index 8dd5d2f64ec3..57e22963e3db 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // queue(queue&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,14 +29,11 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5)); std::queue<MoveOnly> q2 = std::move(q); assert(q2.size() == 5); assert(q.empty()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp index f72067b0adcc..1b3f25608660 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // explicit queue(container_type&& c); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,12 +29,9 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5)); assert(q.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp index 781d74016128..7518bcc71c08 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // queue() @@ -14,8 +16,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 - #include <queue> #include <cassert> @@ -29,5 +29,5 @@ int main() typedef std::queue<MoveOnly> C; static_assert(std::is_nothrow_default_constructible<C>::value, ""); } -#endif // _LIBCPP_VERSION +#endif } diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp index 58c8f9ddfad1..a89fbef8be0d 100644 --- a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // queue(queue&&) @@ -14,7 +16,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 #include <queue> #include <cassert> @@ -29,5 +30,5 @@ int main() typedef std::queue<MoveOnly> C; static_assert(std::is_nothrow_move_constructible<C>::value, ""); } -#endif // _LIBCPP_VERSION +#endif } diff --git a/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp index af1b7e20c338..0932b7d99d8e 100644 --- a/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // queue& operator=(queue&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,15 +29,12 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5)); std::queue<MoveOnly> q2; q2 = std::move(q); assert(q2.size() == 5); assert(q.empty()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp index d8992821f1f2..2e0a19a7fe02 100644 --- a/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp +++ b/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <queue> // void push(value_type&& v); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::queue<MoveOnly> q; q.push(MoveOnly(1)); assert(q.size() == 1); @@ -32,5 +33,4 @@ int main() assert(q.size() == 3); assert(q.front() == MoveOnly(1)); assert(q.back() == MoveOnly(3)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp index 94899d4f1b54..bac8378ebbbb 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp @@ -15,6 +15,7 @@ #include <stack> #include <cassert> +#include "test_macros.h" #include "test_allocator.h" struct test @@ -24,10 +25,10 @@ struct test explicit test(const test_allocator<int>& a) : base(a) {} test(const container_type& c, const test_allocator<int>& a) : base(c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} }; diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp index b3cf39207203..237870b2c220 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp @@ -16,6 +16,7 @@ #include <cassert> #include <cstddef> +#include "test_macros.h" #include "test_allocator.h" template <class C> @@ -37,10 +38,10 @@ struct test explicit test(const test_allocator<int>& a) : base(a) {} test(const container_type& c, const test_allocator<int>& a) : base(c, a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {} test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif test_allocator<int> get_allocator() {return c.get_allocator();} }; diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp index 374aa996ffe3..b0da1ef8b375 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // template <class Alloc> @@ -18,7 +20,6 @@ #include "test_allocator.h" #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -47,13 +48,10 @@ struct test allocator_type get_allocator() {return this->c.get_allocator();} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4)); assert(q.get_allocator() == test_allocator<MoveOnly>(4)); assert(q.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp index 5fa5bd2a8bd2..e75a8a267750 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // template <class Alloc> @@ -18,7 +20,6 @@ #include "test_allocator.h" #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -47,14 +48,11 @@ struct test allocator_type get_allocator() {return this->c.get_allocator();} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4)); test<MoveOnly> q2(std::move(q), test_allocator<MoveOnly>(5)); assert(q2.get_allocator() == test_allocator<MoveOnly>(5)); assert(q2.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp index 44fab41a6c55..d837e3d654a1 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // stack(stack&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,14 +29,11 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5)); std::stack<MoveOnly> q2 = std::move(q); assert(q2.size() == 5); assert(q.empty()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp index ab08da93831e..01d467460a7a 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // explicit stack(container_type&& c); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,12 +29,9 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5)); assert(q.size() == 5); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp index 2e217c545f9c..03c709ef6442 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // stack() @@ -14,7 +16,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 #include <stack> #include <cassert> @@ -29,5 +30,5 @@ int main() typedef std::stack<MoveOnly> C; static_assert(std::is_nothrow_default_constructible<C>::value, ""); } -#endif // _LIBCPP_VERSION +#endif } diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp index af6793f465a2..92aef08baf0d 100644 --- a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // stack(stack&&) @@ -14,8 +16,6 @@ // This tests a conforming extension -// UNSUPPORTED: c++98, c++03 - #include <stack> #include <cassert> @@ -29,5 +29,5 @@ int main() typedef std::stack<MoveOnly> C; static_assert(std::is_nothrow_move_constructible<C>::value, ""); } -#endif // _LIBCPP_VERSION +#endif } diff --git a/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp index 75cbec1c47c8..cbb63462a8d0 100644 --- a/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // stack& operator=(stack&& q); @@ -16,7 +18,6 @@ #include "MoveOnly.h" -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class C> C @@ -28,15 +29,12 @@ make(int n) return c; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5)); std::stack<MoveOnly> q2; q2 = std::move(q); assert(q2.size() == 5); assert(q.empty()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp index 67d0ea3385f6..9165f6ecc1bb 100644 --- a/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp +++ b/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <stack> // void push(value_type&& v); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::stack<MoveOnly> q; q.push(MoveOnly(1)); assert(q.size() == 1); @@ -29,5 +30,4 @@ int main() q.push(MoveOnly(3)); assert(q.size() == 3); assert(q.top() == MoveOnly(3)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp index dbdccf13b72e..785a5be8b749 100644 --- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp +++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp @@ -18,6 +18,21 @@ #include "min_allocator.h" #include "asan_testing.h" +#ifndef TEST_HAS_NO_EXCEPTIONS +struct Throws { + Throws() : v_(0) {} + Throws(int v) : v_(v) {} + Throws(const Throws &rhs) : v_(rhs.v_) { if (sThrows) throw 1; } + Throws( Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; } + Throws& operator=(const Throws &rhs) { v_ = rhs.v_; return *this; } + Throws& operator=( Throws &&rhs) { v_ = rhs.v_; return *this; } + int v_; + static bool sThrows; + }; + +bool Throws::sThrows = false; +#endif + int main() { { @@ -72,4 +87,17 @@ int main() assert(is_contiguous_container_asan_correct(l1)); } #endif +#ifndef TEST_HAS_NO_EXCEPTIONS +// Test for LWG2853: +// Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T. + { + Throws arr[] = {1, 2, 3}; + std::vector<Throws> v(arr, arr+3); + Throws::sThrows = true; + v.erase(v.begin()); + v.erase(--v.end()); + v.erase(v.begin()); + assert(v.size() == 0); + } +#endif } diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp index f7fa0dba27e8..2fc4981b6c9f 100644 --- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp +++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp @@ -18,6 +18,21 @@ #include "min_allocator.h" #include "asan_testing.h" +#ifndef TEST_HAS_NO_EXCEPTIONS +struct Throws { + Throws() : v_(0) {} + Throws(int v) : v_(v) {} + Throws(const Throws &rhs) : v_(rhs.v_) { if (sThrows) throw 1; } + Throws( Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; } + Throws& operator=(const Throws &rhs) { v_ = rhs.v_; return *this; } + Throws& operator=( Throws &&rhs) { v_ = rhs.v_; return *this; } + int v_; + static bool sThrows; + }; + +bool Throws::sThrows = false; +#endif + int main() { int a1[] = {1, 2, 3}; @@ -125,4 +140,17 @@ int main() assert(is_contiguous_container_asan_correct(outer[1])); } #endif +#ifndef TEST_HAS_NO_EXCEPTIONS +// Test for LWG2853: +// Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T. + { + Throws arr[] = {1, 2, 3}; + std::vector<Throws> v(arr, arr+3); + Throws::sThrows = true; + v.erase(v.begin(), --v.end()); + assert(v.size() == 1); + v.erase(v.begin(), v.end()); + assert(v.size() == 0); + } +#endif } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp index 4d92b3d4c2c5..9fca1f105928 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -27,7 +29,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::allocator<std::pair<const int, std::string> > A; typedef std::unordered_map<int, std::string, @@ -60,7 +61,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<std::pair<const int, std::string> > A; typedef std::unordered_map<int, std::string, @@ -93,6 +93,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp index e86d35b0ac8b..0d08fae0c3bc 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef test_allocator<std::pair<const int, std::string> > A; typedef std::unordered_map<int, std::string, @@ -167,7 +168,6 @@ int main() assert(c.max_load_factor() == 1); assert(c0.size() == 0); } -#if TEST_STD_VER >= 11 { typedef min_allocator<std::pair<const int, std::string> > A; typedef std::unordered_map<int, std::string, @@ -214,18 +214,4 @@ int main() assert(c.max_load_factor() == 1); assert(c0.size() == 0); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}}; - std::unordered_map<int, int>::iterator i = s1.begin(); - std::pair<const int, int> k = *i; - std::unordered_map<int, int> s2; - s2 = std::move(s1); - assert(*i == k); - s2.erase(i); - assert(s2.size() == 2); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp index bebab0375d86..b06e4db1303a 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -61,7 +62,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -158,7 +158,5 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // TEST_STD_VER > 11 } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp index 9055e3dcd166..ca48808f4819 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -64,7 +65,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -98,6 +98,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp index db0010b3401c..02360f8ac1bb 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -65,7 +66,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -100,6 +100,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp index c76ce3968ad3..c6a3976560b7 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -31,7 +33,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -67,7 +68,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -103,6 +103,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp index 6cb57d4ff210..5acc4c34bc1f 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -31,7 +33,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -68,7 +69,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, test_hash<std::hash<int> >, @@ -141,6 +141,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp index 681c0e95b937..296363166618 100644 --- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<int, std::string> P; typedef test_allocator<std::pair<const int, std::string>> A; @@ -113,7 +114,6 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef std::pair<int, std::string> P; typedef min_allocator<std::pair<const int, std::string>> A; @@ -196,6 +196,4 @@ int main() assert(c0.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp index 26f716166464..18c83dd31309 100644 --- a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_map<int, Emplaceable> C; typedef std::pair<C::iterator, bool> R; @@ -49,7 +50,6 @@ int main() assert(r.first->first == 5); assert(r.first->second == Emplaceable(6, 7)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, Emplaceable, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, Emplaceable>>> C; @@ -75,6 +75,4 @@ int main() assert(r.first->first == 5); assert(r.first->second == Emplaceable(6, 7)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp index 477f2cf02e76..ce7fa835ce8b 100644 --- a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -16,9 +18,6 @@ // template <class... Args> // iterator emplace_hint(const_iterator p, Args&&... args); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif #include <unordered_map> #include <cassert> @@ -28,7 +27,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_map<int, Emplaceable> C; typedef C::iterator R; @@ -51,7 +49,6 @@ int main() assert(r->first == 5); assert(r->second == Emplaceable(6, 7)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, Emplaceable, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, Emplaceable>>> C; @@ -75,19 +72,4 @@ int main() assert(r->first == 5); assert(r->second == Emplaceable(6, 7)); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_map<int, Emplaceable> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - R r = c.emplace_hint(c2.end(), std::piecewise_construct, - std::forward_as_tuple(3), - std::forward_as_tuple()); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp index a4d8b5d410b4..477a229d0a98 100644 --- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_map<int, std::string> C; typedef std::pair<int, std::string> P; @@ -45,7 +46,6 @@ int main() assert(c.at(3) == "three"); assert(c.at(4) == "four"); } -#if TEST_STD_VER >= 11 { typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; @@ -67,6 +67,4 @@ int main() assert(c.at(3) == "three"); assert(c.at(4) == "four"); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp index 6d27dec98eaa..cefbf4596550 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -28,7 +30,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_allocator<std::pair<const int, std::string> > A; typedef std::unordered_multimap<int, std::string, @@ -85,7 +86,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<std::pair<const int, std::string> > A; typedef std::unordered_multimap<int, std::string, @@ -142,6 +142,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp index b9b8723452fe..9bd55ac92e89 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef test_allocator<std::pair<const int, std::string> > A; typedef std::unordered_multimap<int, std::string, @@ -225,7 +226,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<std::pair<const int, std::string> > A; typedef std::unordered_multimap<int, std::string, @@ -291,18 +291,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}}; - std::unordered_multimap<int, int>::iterator i = s1.begin(); - std::pair<const int, int> k = *i; - std::unordered_multimap<int, int> s2; - s2 = std::move(s1); - assert(*i == k); - s2.erase(i); - assert(s2.size() == 2); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp index 445fd2d82bb2..1a222cef1509 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -83,7 +84,6 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >()); assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >())); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -250,7 +250,5 @@ int main() assert(c.get_allocator() == a); assert(!(c.get_allocator() == A())); } -#endif -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // TEST_STD_VER > 11 } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp index 92a43b482bdf..ef75b6ce00d3 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -86,7 +87,6 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >()); assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >())); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -142,6 +142,4 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >()); assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >())); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp index d7afafcaec92..9981253916f1 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -87,7 +88,6 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >()); assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >())); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -144,6 +144,4 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >()); assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >())); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp index 9842a4bbdaf9..1ca94641cac7 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -31,7 +33,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -89,7 +90,6 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >())); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -147,6 +147,4 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >())); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp index 244c3f5c657c..e8efefbee692 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -31,7 +33,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -90,7 +91,6 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >(10))); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, test_hash<std::hash<int> >, @@ -208,6 +208,4 @@ int main() assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert(c.get_allocator() == A{}); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp index 878ef598f8cb..0e004522c8d5 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -32,7 +34,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::pair<int, std::string> P; typedef test_allocator<std::pair<const int, std::string>> A; @@ -161,7 +162,6 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef std::pair<int, std::string> P; typedef min_allocator<std::pair<const int, std::string>> A; @@ -290,6 +290,4 @@ int main() assert(c0.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp index 96678cf33fa5..68e5267a9f56 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multimap<int, Emplaceable> C; typedef C::iterator R; @@ -46,7 +47,6 @@ int main() assert(r->first == 5); assert(r->second == Emplaceable(6, 7)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, Emplaceable, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, Emplaceable>>> C; @@ -69,6 +69,4 @@ int main() assert(r->first == 5); assert(r->second == Emplaceable(6, 7)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp index a8095135c1c0..86950e289f3b 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -16,9 +18,6 @@ // template <class... Args> // iterator emplace_hint(const_iterator p, Args&&... args); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif #include <unordered_map> #include <cassert> @@ -29,7 +28,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multimap<int, Emplaceable> C; typedef C::iterator R; @@ -60,7 +58,6 @@ int main() assert(r->first == 3); LIBCPP_ASSERT(r->second == Emplaceable(5, 6)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, Emplaceable, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, Emplaceable>>> C; @@ -92,19 +89,4 @@ int main() assert(r->first == 3); LIBCPP_ASSERT(r->second == Emplaceable(5, 6)); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_multimap<int, Emplaceable> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - R r = c.emplace_hint(c2.end(), std::piecewise_construct, - std::forward_as_tuple(3), - std::forward_as_tuple()); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp index e0b1c6941862..ef1577170f87 100644 --- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp +++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, @@ -25,7 +27,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multimap<int, std::string> C; typedef std::pair<int, std::string> P; @@ -71,7 +72,6 @@ int main() assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size()); assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size()); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, std::string>>> C; @@ -118,6 +118,4 @@ int main() assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size()); assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size()); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/emplace.pass.cpp b/test/std/containers/unord/unord.multiset/emplace.pass.cpp index d8d9e9bc5695..5d925c8d40a7 100644 --- a/test/std/containers/unord/unord.multiset/emplace.pass.cpp +++ b/test/std/containers/unord/unord.multiset/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multiset<Emplaceable> C; typedef C::iterator R; @@ -41,7 +42,6 @@ int main() assert(c.size() == 3); assert(*r == Emplaceable(5, 6)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>, std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C; @@ -59,6 +59,4 @@ int main() assert(c.size() == 3); assert(*r == Emplaceable(5, 6)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp b/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp index 3756476dc8fc..d9bab1f490e6 100644 --- a/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp +++ b/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -16,9 +18,6 @@ // template <class... Args> // iterator emplace_hint(const_iterator p, Args&&... args); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif #include <unordered_set> #include <cassert> @@ -28,7 +27,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multiset<Emplaceable> C; typedef C::iterator R; @@ -46,7 +44,6 @@ int main() assert(c.size() == 3); assert(*r == Emplaceable(5, 6)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>, std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C; @@ -65,16 +62,4 @@ int main() assert(c.size() == 3); assert(*r == Emplaceable(5, 6)); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_multiset<Emplaceable> C; - typedef C::iterator R; - C c1; - C c2; - R r = c1.emplace_hint(c2.begin(), 5, 6); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp index f5026e102c42..ffe6534b249a 100644 --- a/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp +++ b/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp @@ -15,13 +15,10 @@ // iterator insert(const_iterator p, value_type&& x); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - #include <unordered_set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "min_allocator.h" @@ -49,7 +46,7 @@ int main() assert(c.size() == 4); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<MoveOnly> C; typedef C::iterator R; @@ -72,8 +69,6 @@ int main() assert(c.size() == 4); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; @@ -97,7 +92,6 @@ int main() assert(c.size() == 4); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C; @@ -121,18 +115,5 @@ int main() assert(c.size() == 4); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_multiset<double> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - C::const_iterator e = c2.end(); - R r = c.insert(e, P(3.5)); - assert(false); - } -#endif -#endif +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/containers/unord/unord.multiset/insert_init.pass.cpp b/test/std/containers/unord/unord.multiset/insert_init.pass.cpp index 9010cac99caf..88661b5699cb 100644 --- a/test/std/containers/unord/unord.multiset/insert_init.pass.cpp +++ b/test/std/containers/unord/unord.multiset/insert_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int> C; typedef int P; @@ -44,7 +45,6 @@ int main() assert(c.count(3) == 1); assert(c.count(4) == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; @@ -66,6 +66,4 @@ int main() assert(c.count(3) == 1); assert(c.count(4) == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp index 04f9e34164ab..89394901071f 100644 --- a/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp +++ b/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp @@ -18,6 +18,7 @@ #include <unordered_set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "min_allocator.h" @@ -44,7 +45,7 @@ int main() assert(c.size() == 4); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<MoveOnly> C; typedef C::iterator R; @@ -66,8 +67,6 @@ int main() assert(c.size() == 4); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; @@ -90,7 +89,6 @@ int main() assert(c.size() == 4); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C; @@ -113,6 +111,5 @@ int main() assert(c.size() == 4); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp index 3e42305309fd..ce664034d1e1 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -27,7 +29,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_allocator<int> A; typedef std::unordered_multiset<int, @@ -60,7 +61,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<int> A; typedef std::unordered_multiset<int, @@ -93,6 +93,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp index 658bb93e2b1a..dfcb63e6e0eb 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -28,7 +30,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef test_allocator<int> A; typedef std::unordered_multiset<int, @@ -172,7 +173,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef test_allocator<int> A; typedef std::unordered_multiset<int, @@ -263,18 +263,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - std::unordered_multiset<int> s1 = {1, 2, 3}; - std::unordered_multiset<int>::iterator i = s1.begin(); - int k = *i; - std::unordered_multiset<int> s2; - s2 = std::move(s1); - assert(*i == k); - s2.erase(i); - assert(s2.size() == 2); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp index ced52b5e6b46..df49abe077ca 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -28,7 +30,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -59,7 +60,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -159,7 +159,5 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // TEST_STD_VER > 11 } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp index 845139f98d9c..b83507934653 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -62,7 +63,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -95,6 +95,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp index 4dc78bd261cb..92edfc35b9b1 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -64,7 +65,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -98,6 +98,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp index f331208596b7..877306db6620 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -65,7 +66,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -100,6 +100,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp index 17f064f46280..e77be84630ea 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -66,7 +67,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_multiset<int, test_hash<std::hash<int> >, @@ -102,6 +102,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp index bc804b42e22d..fb144d9b1e3f 100644 --- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp +++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int P; typedef test_allocator<int> A; @@ -120,7 +121,6 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef int P; typedef min_allocator<int> A; @@ -203,6 +203,4 @@ int main() assert(c0.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.set/emplace.pass.cpp b/test/std/containers/unord/unord.set/emplace.pass.cpp index 19af8065819c..c09ad1505cd5 100644 --- a/test/std/containers/unord/unord.set/emplace.pass.cpp +++ b/test/std/containers/unord/unord.set/emplace.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -24,7 +26,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_set<Emplaceable> C; typedef std::pair<C::iterator, bool> R; @@ -44,7 +45,6 @@ int main() assert(*r.first == Emplaceable(5, 6)); assert(!r.second); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>, std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C; @@ -65,6 +65,4 @@ int main() assert(*r.first == Emplaceable(5, 6)); assert(!r.second); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.set/emplace_hint.pass.cpp b/test/std/containers/unord/unord.set/emplace_hint.pass.cpp index 97f3591d012b..16f9eff196a6 100644 --- a/test/std/containers/unord/unord.set/emplace_hint.pass.cpp +++ b/test/std/containers/unord/unord.set/emplace_hint.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -16,9 +18,6 @@ // template <class... Args> // iterator emplace_hint(const_iterator p, Args&&... args); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif #include <unordered_set> #include <cassert> @@ -28,7 +27,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_set<Emplaceable> C; typedef C::iterator R; @@ -46,7 +44,6 @@ int main() assert(c.size() == 2); assert(*r == Emplaceable(5, 6)); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>, std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C; @@ -65,16 +62,4 @@ int main() assert(c.size() == 2); assert(*r == Emplaceable(5, 6)); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_set<Emplaceable> C; - typedef C::iterator R; - C c1; - C c2; - R r = c1.emplace_hint(c2.begin(), 5, 6); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp index da94bc55382f..676c395270e9 100644 --- a/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp +++ b/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp @@ -15,13 +15,10 @@ // iterator insert(const_iterator p, value_type&& x); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif - #include <unordered_set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "min_allocator.h" @@ -49,7 +46,7 @@ int main() assert(c.size() == 3); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 { typedef std::unordered_set<MoveOnly> C; typedef C::iterator R; @@ -72,8 +69,6 @@ int main() assert(c.size() == 3); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::unordered_set<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; @@ -97,7 +92,6 @@ int main() assert(c.size() == 3); assert(*r == 5.5); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C; @@ -121,18 +115,5 @@ int main() assert(c.size() == 3); assert(*r == 5); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if _LIBCPP_DEBUG >= 1 - { - typedef std::unordered_set<double> C; - typedef C::iterator R; - typedef C::value_type P; - C c; - C c2; - C::const_iterator e = c2.end(); - R r = c.insert(e, P(3.5)); - assert(false); - } -#endif -#endif +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/containers/unord/unord.set/insert_init.pass.cpp b/test/std/containers/unord/unord.set/insert_init.pass.cpp index 27b7290eb341..c106fed107e3 100644 --- a/test/std/containers/unord/unord.set/insert_init.pass.cpp +++ b/test/std/containers/unord/unord.set/insert_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_set<int> C; typedef int P; @@ -44,7 +45,6 @@ int main() assert(c.count(3) == 1); assert(c.count(4) == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; @@ -66,6 +66,4 @@ int main() assert(c.count(3) == 1); assert(c.count(4) == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp index 5d12f225cc6a..45b168d89a5c 100644 --- a/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp +++ b/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp @@ -18,6 +18,7 @@ #include <unordered_set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "min_allocator.h" @@ -48,7 +49,7 @@ int main() assert(*r.first == 5.5); assert(r.second); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 { typedef std::unordered_set<MoveOnly> C; typedef std::pair<C::iterator, bool> R; @@ -74,8 +75,6 @@ int main() assert(*r.first == 5); assert(r.second); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#if TEST_STD_VER >= 11 { typedef std::unordered_set<double, std::hash<double>, std::equal_to<double>, min_allocator<double>> C; @@ -102,7 +101,6 @@ int main() assert(*r.first == 5.5); assert(r.second); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>, std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C; @@ -129,6 +127,5 @@ int main() assert(*r.first == 5); assert(r.second); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#endif +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp index 2db01a21eaac..4f7ccfec652e 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -27,7 +29,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef test_allocator<int> A; typedef std::unordered_set<int, @@ -60,7 +61,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<int> A; typedef std::unordered_set<int, @@ -93,6 +93,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp index 78a376335c3f..bc3658243995 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -28,7 +30,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef test_allocator<int> A; typedef std::unordered_set<int, @@ -164,7 +165,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef min_allocator<int> A; typedef std::unordered_set<int, @@ -210,18 +210,4 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - std::unordered_set<int> s1 = {1, 2, 3}; - std::unordered_set<int>::iterator i = s1.begin(); - int k = *i; - std::unordered_set<int> s2; - s2 = std::move(s1); - assert(*i == k); - s2.erase(i); - assert(s2.size() == 2); - } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp index eea61c7ab46c..7ba340bf9c3e 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -28,8 +30,7 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - { + { typedef std::unordered_set<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, @@ -59,7 +60,6 @@ int main() assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -160,6 +160,4 @@ int main() assert(c.max_load_factor() == 1); } #endif -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp index 95baa3df2852..0ca9b48572d9 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -29,7 +31,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -62,7 +63,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -95,6 +95,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp index 108d67b66b22..45ed588a7bac 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -64,7 +65,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -98,6 +98,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp index 5cb4d499a937..8ace22a5877a 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -65,7 +66,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -100,6 +100,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp index 7c1cbc8667de..4fd50a818fb8 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -30,7 +32,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -66,7 +67,6 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#if TEST_STD_VER >= 11 { typedef std::unordered_set<int, test_hash<std::hash<int> >, @@ -102,6 +102,4 @@ int main() assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp index 4d2830b3a808..bcd10b0775e4 100644 --- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp +++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, @@ -28,7 +30,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { typedef int P; typedef test_allocator<int> A; @@ -111,7 +112,6 @@ int main() assert(c0.empty()); } -#if TEST_STD_VER >= 11 { typedef int P; typedef min_allocator<int> A; @@ -153,6 +153,4 @@ int main() assert(c0.empty()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp index a92ec872a54b..66409543f447 100644 --- a/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::filebuf f; @@ -52,5 +53,4 @@ int main() assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp index f13ee44700f3..96806fbfeb45 100644 --- a/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::filebuf f; @@ -50,5 +51,4 @@ int main() assert(f2.sgetc() == L'2'); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp index b5157e90edcc..b143bd4a55ed 100644 --- a/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::fstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out @@ -46,5 +47,4 @@ int main() assert(x == 3.25); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp index d2ae3028606c..556cc858a664 100644 --- a/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::fstream fso(temp, std::ios_base::in | std::ios_base::out @@ -44,5 +45,4 @@ int main() assert(x == 3.25); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp index 9c2fcad33a3c..36fa29a4e513 100644 --- a/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::ifstream fso("test.dat"); std::ifstream fs; @@ -36,5 +37,4 @@ int main() fs >> x; assert(x == 3.25); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp index aaac1212262d..eeb06e0e59a6 100644 --- a/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::ifstream fso("test.dat"); std::ifstream fs = move(fso); @@ -34,5 +35,4 @@ int main() fs >> x; assert(x == 3.25); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp index 0f21eb81d078..094f55073354 100644 --- a/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::ofstream fso(temp.c_str()); @@ -48,5 +49,4 @@ int main() assert(x == 3.25); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp index 8645358cbd4d..fe885cf4088e 100644 --- a/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp +++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <fstream> // template <class charT, class traits = char_traits<charT> > @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::string temp = get_temp_file_name(); { std::ofstream fso(temp.c_str()); @@ -46,5 +47,4 @@ int main() assert(x == 3.25); } std::remove(temp.c_str()); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp index 2032e935bfac..cf6c8ae68efa 100644 --- a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <istream> // template <class charT, class traits = char_traits<charT> > @@ -17,7 +19,6 @@ #include <istream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> struct testbuf @@ -37,11 +38,9 @@ struct test_iostream {base::operator=(std::move(s)); return *this;} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb1; testbuf<char> sb2; @@ -88,5 +87,4 @@ int main() assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp index c0592e927c8f..e8fd00c7ac07 100644 --- a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <istream> // template <class charT, class traits = char_traits<charT> > @@ -17,7 +19,6 @@ #include <istream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> struct testbuf @@ -37,11 +38,9 @@ struct test_iostream : base(std::move(s)) {} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb; test_iostream<char> is1(&sb); @@ -74,5 +73,4 @@ int main() assert(is.precision() == 6); assert(is.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp index 2876d76c1984..18887b75de29 100644 --- a/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp +++ b/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <istream> // template <class charT, class traits = char_traits<charT> > @@ -17,7 +19,6 @@ #include <istream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> struct testbuf @@ -37,11 +38,9 @@ struct test_istream {base::operator=(std::move(s)); return *this;} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb1; testbuf<char> sb2; @@ -88,5 +87,4 @@ int main() assert(is2.precision() == 6); assert(is2.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp index 40fe0795de53..1b58a9a524e9 100644 --- a/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp +++ b/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <ostream> // template <class charT, class traits = char_traits<charT> > @@ -17,7 +19,6 @@ #include <ostream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> struct testbuf @@ -37,11 +38,9 @@ struct test_ostream {base::operator=(std::move(s)); return *this;} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb1; testbuf<char> sb2; @@ -88,5 +87,4 @@ int main() assert(os2.precision() == 6); assert(os2.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp index b3045b3232e6..7d225d49546d 100644 --- a/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp +++ b/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <ostream> // template <class charT, class traits = char_traits<charT> > @@ -17,7 +19,6 @@ #include <ostream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> struct testbuf @@ -37,11 +38,9 @@ struct test_ostream : base(std::move(s)) {} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb; test_ostream<char> os1(&sb); @@ -70,5 +69,4 @@ int main() assert(os.precision() == 6); assert(os.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp index 8be0b51d9fdf..83210c08767a 100644 --- a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp +++ b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <ostream> // template <class charT, class traits = char_traits<charT> > @@ -19,7 +21,6 @@ #include <ostream> #include <cassert> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class CharT> class testbuf @@ -53,11 +54,9 @@ protected: } }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf<char> sb; std::ostream(&sb) << "testing..."; @@ -68,5 +67,4 @@ int main() std::wostream(&sb) << L"123"; assert(sb.str() == L"123"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp index e57ad55c9078..2a428c5d92d8 100644 --- a/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp +++ b/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::istringstream ss0(" 123 456"); std::istringstream ss; @@ -82,5 +83,4 @@ int main() s1 >> s; assert(s == L"Dddddddddddddddddd"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp index adc46ab65f5e..0a45b796be09 100644 --- a/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp +++ b/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::istringstream ss0(" 123 456"); std::istringstream ss(std::move(ss0)); @@ -44,5 +45,4 @@ int main() ss >> i; assert(i == 456); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp index a52068595178..8801001f41a3 100644 --- a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp +++ b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::ostringstream ss0(" 123 456"); std::ostringstream ss; @@ -42,5 +43,4 @@ int main() ss << i << ' ' << 567; assert(ss.str() == L"234 5676"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp index 3d9e305e0408..67bfc50cd87a 100644 --- a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp +++ b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::ostringstream ss0(" 123 456"); std::ostringstream ss(std::move(ss0)); @@ -40,5 +41,4 @@ int main() ss << i << ' ' << 567; assert(ss.str() == L"234 5676"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp index 4ae3aa6e84db..436c76c5bfde 100644 --- a/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp +++ b/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::stringstream ss0(" 123 456 "); std::stringstream ss(std::move(ss0)); @@ -48,5 +49,4 @@ int main() ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp index 78d682fc44f6..94de616108f1 100644 --- a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp +++ b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES std::vector<std::istringstream> vecis; vecis.push_back(std::istringstream()); vecis.back().str("hub started at [00 6b 8b 45 69]"); @@ -34,5 +35,4 @@ int main() vecis[n].seekg(0, std::ios_base::beg); assert(vecis[n].str().size() == 31); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp index ccaf72d7e550..3cce695c49da 100644 --- a/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp +++ b/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <sstream> // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> > @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::stringstream ss0(" 123 456 "); std::stringstream ss; @@ -50,5 +51,4 @@ int main() ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp index 26be4db38fba..6a9f25cd0855 100644 --- a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp +++ b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp @@ -113,7 +113,7 @@ int main() std::throw_with_nested("String literal"); assert(false); } - catch (const char * s) + catch (const char *) { } } diff --git a/test/std/language.support/support.initlist/include_cxx03.pass.cpp b/test/std/language.support/support.initlist/include_cxx03.pass.cpp new file mode 100644 index 000000000000..8710ddcdde72 --- /dev/null +++ b/test/std/language.support/support.initlist/include_cxx03.pass.cpp @@ -0,0 +1,18 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <initializer_list> + +// Test that the file can be included in C++03 + +#include <initializer_list> + +int main() +{ +} diff --git a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp index e51ef7bd9230..f6fd5564f55f 100644 --- a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // template<class E> class initializer_list; // const E* begin() const; @@ -19,8 +21,6 @@ #include "test_macros.h" -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - struct A { A(std::initializer_list<int> il) @@ -52,13 +52,9 @@ struct B #endif // TEST_STD_VER > 11 -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS A test1 = {3, 2, 1}; -#endif #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; #endif // TEST_STD_VER > 11 diff --git a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp index e091834340aa..2d831c9e1d1e 100644 --- a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // template<class E> class initializer_list; // initializer_list(); @@ -20,10 +22,9 @@ struct A {}; int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS std::initializer_list<A> il; assert(il.size() == 0); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + #if TEST_STD_VER > 11 constexpr std::initializer_list<A> il2; static_assert(il2.size() == 0, ""); diff --git a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp index 938025d385fa..102ed64fef9b 100644 --- a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <initializer_list> // template<class E> const E* begin(initializer_list<E> il); @@ -17,8 +19,6 @@ #include "test_macros.h" -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - struct A { A(std::initializer_list<int> il) @@ -49,13 +49,10 @@ struct B }; #endif // TEST_STD_VER > 11 -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS A test1 = {3, 2, 1}; -#endif #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; #endif // TEST_STD_VER > 11 diff --git a/test/std/language.support/support.initlist/types.pass.cpp b/test/std/language.support/support.initlist/types.pass.cpp index 835830055ff4..a301ef924614 100644 --- a/test/std/language.support/support.initlist/types.pass.cpp +++ b/test/std/language.support/support.initlist/types.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // template<class E> // class initializer_list // { @@ -26,12 +28,10 @@ struct A {}; int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS static_assert((std::is_same<std::initializer_list<A>::value_type, A>::value), ""); static_assert((std::is_same<std::initializer_list<A>::reference, const A&>::value), ""); static_assert((std::is_same<std::initializer_list<A>::const_reference, const A&>::value), ""); static_assert((std::is_same<std::initializer_list<A>::size_type, std::size_t>::value), ""); static_assert((std::is_same<std::initializer_list<A>::iterator, const A*>::value), ""); static_assert((std::is_same<std::initializer_list<A>::const_iterator, const A*>::value), ""); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/complex.number/complex.literals/literals.pass.cpp b/test/std/numerics/complex.number/complex.literals/literals.pass.cpp index a2e53629f97d..8831ca1d6ee1 100644 --- a/test/std/numerics/complex.number/complex.literals/literals.pass.cpp +++ b/test/std/numerics/complex.number/complex.literals/literals.pass.cpp @@ -14,6 +14,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + int main() { using namespace std::literals::complex_literals; diff --git a/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp b/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp index 67e0fa131fd0..6cc911d4e5e6 100644 --- a/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp +++ b/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp @@ -12,6 +12,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { std::complex<float> foo = 1.0if; // should fail w/conversion operator not found diff --git a/test/std/numerics/complex.number/complex.members/construct.pass.cpp b/test/std/numerics/complex.number/complex.members/construct.pass.cpp index b4d870fad11e..25b9ce62cc1d 100644 --- a/test/std/numerics/complex.number/complex.members/construct.pass.cpp +++ b/test/std/numerics/complex.number/complex.members/construct.pass.cpp @@ -14,6 +14,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + template <class T> void test() @@ -38,7 +40,7 @@ test() assert(c.real() == 10.5); assert(c.imag() == -9.5); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<T> c; static_assert(c.real() == 0, ""); diff --git a/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp index e8d07ce287d0..ac26e3c9eeda 100644 --- a/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<float> cd(2.5, 3.5); constexpr std::complex<double> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp index 298aaa3a7a8a..3bb01ac46500 100644 --- a/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<float> cd(2.5, 3.5); constexpr std::complex<double> cf = cd; diff --git a/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp index 6ff74a2cdef3..97c2580249ca 100644 --- a/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<long double> cd(2.5, 3.5); constexpr std::complex<double> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp index 77ca9d7f2aac..3027d4cdcc0c 100644 --- a/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<double> cd(2.5, 3.5); constexpr std::complex<float> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp index 4fb11b4ca27c..515e83dfc46e 100644 --- a/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<long double> cd(2.5, 3.5); constexpr std::complex<float> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp index dd10c808b90a..4f24a1c6575d 100644 --- a/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<double> cd(2.5, 3.5); constexpr std::complex<long double> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp index aab539407d0f..8cbd7a8a12cd 100644 --- a/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<double> cd(2.5, 3.5); constexpr std::complex<long double> cf = cd; diff --git a/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp index a5f5101c4dc8..7930548f9f38 100644 --- a/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<float> cd(2.5, 3.5); constexpr std::complex<long double> cf(cd); diff --git a/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp index 25b93823f6ed..22b9fd08ac25 100644 --- a/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp +++ b/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp @@ -18,6 +18,8 @@ #include <complex> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() assert(cf.real() == cd.real()); assert(cf.imag() == cd.imag()); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::complex<float> cd(2.5, 3.5); constexpr std::complex<long double> cf = cd; diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp index 7a671a73eee6..5122f44c3d80 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <valarray> // template<class T> class valarray; @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef int T; T a[] = {1, 2, 3, 4, 5}; @@ -54,5 +55,4 @@ int main() assert(v2[i][j] == a[i][j]); } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp index 4dfbe11bde9c..ce385e65c2ad 100644 --- a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp +++ b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <valarray> // template<class T> class valarray; @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef int T; T a[] = {1, 2, 3, 4, 5}; @@ -37,5 +38,4 @@ int main() for (unsigned i = 0; i < N; ++i) assert(v[i] == a[i]); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp index f819f48b1975..8cc523e2fc07 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp @@ -26,6 +26,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class _Tp> void where(const _Tp &) {} diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp index 187a71edcd7e..6076f934ff71 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp @@ -24,6 +24,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + void test1() { diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp index be5b4a9786af..c592b6df2d6e 100644 --- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp +++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp @@ -25,6 +25,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class _Tp> void where(const _Tp &) {} diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp index bc4494b9848e..031839317093 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class IntType = int> @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::discrete_distribution<> D; D d = {}; @@ -77,5 +78,4 @@ int main() assert(p[1] == 0); assert(p[2] == 1); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp index 1071305f4db7..bd2a8c83d8ec 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class IntType = int> @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::discrete_distribution<> D; typedef D::param_type P; @@ -28,5 +29,4 @@ int main() assert(p.size() == 1); assert(p[0] == 1); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp index 79d8a0b71a92..1144bfed33fd 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class IntType = int> @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::discrete_distribution<> D; typedef D::param_type P; @@ -84,5 +85,4 @@ int main() assert(p[1] == 0); assert(p[2] == 1); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp index d4f339fe7f3b..e901afc39742 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_constant_distribution<> D; D d; @@ -31,5 +32,4 @@ int main() assert(dn.size() == 1); assert(dn[0] == 1); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp index 5708e45093cb..ecc3c892236a 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -27,7 +29,6 @@ double f(double x) int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_constant_distribution<> D; D d({}, f); @@ -74,5 +75,4 @@ int main() assert(dn[0] == 0.203125); assert(dn[1] == 0.1484375); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp index fa6530979ed8..c037338cdea0 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -24,7 +26,6 @@ double f(double x) int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_constant_distribution<> D; typedef D::param_type P; @@ -75,5 +76,4 @@ int main() assert(dn[0] == 0.203125); assert(dn[1] == 0.1484375); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp index 745bd6b97ec8..99b0f5f4b27f 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_linear_distribution<> D; D d; @@ -32,5 +33,4 @@ int main() assert(dn[0] == 1); assert(dn[1] == 1); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp index 44c76f0cf6cb..77371de453d0 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -27,7 +29,6 @@ double f(double x) int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_linear_distribution<> D; D d({}, f); @@ -78,5 +79,4 @@ int main() assert(dn[1] == 0.125); assert(dn[2] == 0.175); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp index cfa416434a29..518a4f265acf 100644 --- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp +++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // template<class RealType = double> @@ -24,7 +26,6 @@ double f(double x) int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { typedef std::piecewise_linear_distribution<> D; typedef D::param_type P; @@ -79,5 +80,4 @@ int main() assert(dn[1] == 0.125); assert(dn[2] == 0.175); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index cd496fdbc5e0..2080ac5f41de 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -25,6 +25,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class _Tp> void where(const _Tp &) {} diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp index 3a16d62d728d..f7834afd4454 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp @@ -40,6 +40,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class _Tp> void where(const _Tp &) {} diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp index b3f12e72383b..6b8b4eed97a9 100644 --- a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp +++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp @@ -28,6 +28,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class _Tp> void where(const _Tp &) {} diff --git a/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp b/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp index d4ee9c14d528..c0921d913665 100644 --- a/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp +++ b/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <random> // class seed_seq; @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS std::seed_seq s= {5, 4, 3, 2, 1}; assert(s.size() == 5); unsigned b[5] = {0}; @@ -29,5 +30,4 @@ int main() assert(b[2] == 3); assert(b[3] == 2); assert(b[4] == 1); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp b/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp index 6cffc0da9a52..849ec4ae51f6 100644 --- a/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp +++ b/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <regex> // class regex_token_iterator<BidirectionalIterator, charT, traits> @@ -23,7 +25,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::regex phone_numbers("\\d{3}-(\\d{4})"); const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end"; @@ -61,5 +62,4 @@ int main() ++i; assert(i == std::cregex_token_iterator()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp b/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp index 39c3a22ef725..fcaee8c3d686 100644 --- a/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp +++ b/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <regex> // template <class charT, class traits = regex_traits<charT>> class basic_regex; @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS std::regex r2; r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}); assert(r2.flags() == std::regex::ECMAScript); @@ -30,5 +31,4 @@ int main() r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended); assert(r2.flags() == std::regex::extended); assert(r2.mark_count() == 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/re/re.regex/re.regex.assign/il.pass.cpp b/test/std/re/re.regex/re.regex.assign/il.pass.cpp index 022170f2d136..a74d9cf6ed11 100644 --- a/test/std/re/re.regex/re.regex.assign/il.pass.cpp +++ b/test/std/re/re.regex/re.regex.assign/il.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <regex> // template <class charT, class traits = regex_traits<charT>> class basic_regex; @@ -19,10 +21,8 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS std::regex r2; r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}; assert(r2.flags() == std::regex::ECMAScript); assert(r2.mark_count() == 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp b/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp index c1554d6c3ebb..87dcc856940b 100644 --- a/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp +++ b/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <regex> // template <class charT, class traits = regex_traits<charT>> class basic_regex; @@ -18,7 +20,6 @@ #include <cassert> #include "test_macros.h" -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS void test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc) @@ -28,11 +29,9 @@ test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, assert(r.mark_count() == mc); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS std::string s1("\\(a\\)"); std::string s2("\\(a[bc]\\)"); std::string s3("\\(a\\([bc]\\)\\)"); @@ -67,5 +66,4 @@ int main() test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::egrep, 0); test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::egrep, 0); test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::egrep, 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp index 2adf846c1e36..c5b7cbf9d97e 100644 --- a/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp @@ -7,13 +7,12 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <string> // iterator insert(const_iterator p, initializer_list<charT> il); -#if _LIBCPP_DEBUG >= 1 -#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0)) -#endif #include <string> #include <cassert> @@ -22,14 +21,12 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::string s("123456"); std::string::iterator i = s.insert(s.begin() + 3, {'a', 'b', 'c'}); assert(i - s.begin() == 3); assert(s == "123abc456"); } -#if TEST_STD_VER >= 11 { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; S s("123456"); @@ -37,14 +34,4 @@ int main() assert(i - s.begin() == 3); assert(s == "123abc456"); } -#endif -#if _LIBCPP_DEBUG >= 1 - { - std::string s; - std::string s2; - s.insert(s2.begin(), {'a', 'b', 'c'}); - assert(false); - } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp index b60a58c55e0e..2a705ebf442f 100644 --- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <string> // basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<charT> il); @@ -18,19 +20,15 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::string s("123def456"); s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'}); assert(s == "123abc456"); } -#if TEST_STD_VER >= 11 { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; S s("123def456"); s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'}); assert(s == "123abc456"); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp index 48d1854808c0..5dbfe9d4dbe1 100644 --- a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <string> // template<class charT, class traits, class Allocator> @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::string s("initial text"); getline(std::istringstream(" abc* def* ghij"), s, '*'); @@ -33,7 +34,6 @@ int main() getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } -#if TEST_STD_VER >= 11 { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; S s("initial text"); @@ -46,6 +46,4 @@ int main() getline(std::wistringstream(L" abc* def* ghij"), s, L'*'); assert(s == L" abc"); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp index 18c22f915ca0..0c1fa8203415 100644 --- a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <string> // template<class charT, class traits, class Allocator> @@ -22,7 +24,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::string s("initial text"); getline(std::istringstream(" abc\n def\n ghij"), s); @@ -33,7 +34,6 @@ int main() getline(std::wistringstream(L" abc\n def\n ghij"), s); assert(s == L" abc"); } -#if TEST_STD_VER >= 11 { typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; S s("initial text"); @@ -46,6 +46,4 @@ int main() getline(std::wistringstream(L" abc\n def\n ghij"), s); assert(s == L" abc"); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp index 9a8213e230fb..7bf7da8900f5 100644 --- a/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp @@ -21,60 +21,50 @@ #include <utility> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> -void -test0(typename S::value_type lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); +void test0(typename S::value_type lhs, const S& rhs, const S& x) { + assert(lhs + rhs == x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#if TEST_STD_VER >= 11 template <class S> -void -test1(typename S::value_type lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); +void test1(typename S::value_type lhs, S&& rhs, const S& x) { + assert(lhs + move(rhs) == x); } +#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { +int main() { + { typedef std::string S; test0('a', S(""), S("a")); test0('a', S("12345"), S("a12345")); test0('a', S("1234567890"), S("a1234567890")); test0('a', S("12345678901234567890"), S("a12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - + } +#if TEST_STD_VER >= 11 + { + typedef std::string S; test1('a', S(""), S("a")); test1('a', S("12345"), S("a12345")); test1('a', S("1234567890"), S("a1234567890")); test1('a', S("12345678901234567890"), S("a12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if TEST_STD_VER >= 11 - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; + } + { + typedef std::basic_string<char, std::char_traits<char>, + min_allocator<char> > + S; test0('a', S(""), S("a")); test0('a', S("12345"), S("a12345")); test0('a', S("1234567890"), S("a1234567890")); test0('a', S("12345678901234567890"), S("a12345678901234567890")); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - test1('a', S(""), S("a")); test1('a', S("12345"), S("a12345")); test1('a', S("1234567890"), S("a1234567890")); test1('a', S("12345678901234567890"), S("a12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } + } #endif } diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp index 88fa678ec44f..090707fd8695 100644 --- a/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp @@ -21,29 +21,23 @@ #include <utility> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> -void -test0(const typename S::value_type* lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); +void test0(const typename S::value_type* lhs, const S& rhs, const S& x) { + assert(lhs + rhs == x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#if TEST_STD_VER >= 11 template <class S> -void -test1(const typename S::value_type* lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); +void test1(const typename S::value_type* lhs, S&& rhs, const S& x) { + assert(lhs + move(rhs) == x); } +#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { +int main() { + { typedef std::string S; test0("", S(""), S("")); test0("", S("12345"), S("12345")); @@ -56,14 +50,19 @@ int main() test0("abcdefghij", S(""), S("abcdefghij")); test0("abcdefghij", S("12345"), S("abcdefghij12345")); test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test0("abcdefghij", S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + test0("abcdefghijklmnopqrst", S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test0("abcdefghijklmnopqrst", S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } +#if TEST_STD_VER >= 11 + { + typedef std::string S; test1("", S(""), S("")); test1("", S("12345"), S("12345")); test1("", S("1234567890"), S("1234567890")); @@ -75,17 +74,19 @@ int main() test1("abcdefghij", S(""), S("abcdefghij")); test1("abcdefghij", S("12345"), S("abcdefghij12345")); test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test1("abcdefghij", S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if TEST_STD_VER >= 11 - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; + test1("abcdefghijklmnopqrst", S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test1("abcdefghijklmnopqrst", S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } + { + typedef std::basic_string<char, std::char_traits<char>, + min_allocator<char> > + S; test0("", S(""), S("")); test0("", S("12345"), S("12345")); test0("", S("1234567890"), S("1234567890")); @@ -97,13 +98,14 @@ int main() test0("abcdefghij", S(""), S("abcdefghij")); test0("abcdefghij", S("12345"), S("abcdefghij12345")); test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test0("abcdefghij", S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + test0("abcdefghijklmnopqrst", S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test0("abcdefghijklmnopqrst", S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test1("", S(""), S("")); test1("", S("12345"), S("12345")); @@ -116,13 +118,14 @@ int main() test1("abcdefghij", S(""), S("abcdefghij")); test1("abcdefghij", S("12345"), S("abcdefghij12345")); test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890")); - test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test1("abcdefghij", S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst")); test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345")); - test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } + test1("abcdefghijklmnopqrst", S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test1("abcdefghijklmnopqrst", S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } #endif } diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp index b4c2c97043cc..9bc3a4d41b32 100644 --- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp @@ -21,60 +21,50 @@ #include <utility> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> -void -test0(const S& lhs, typename S::value_type rhs, const S& x) -{ - assert(lhs + rhs == x); +void test0(const S& lhs, typename S::value_type rhs, const S& x) { + assert(lhs + rhs == x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#if TEST_STD_VER >= 11 template <class S> -void -test1(S&& lhs, typename S::value_type rhs, const S& x) -{ - assert(move(lhs) + rhs == x); +void test1(S&& lhs, typename S::value_type rhs, const S& x) { + assert(move(lhs) + rhs == x); } +#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { +int main() { + { typedef std::string S; test0(S(""), '1', S("1")); test0(S("abcde"), '1', S("abcde1")); test0(S("abcdefghij"), '1', S("abcdefghij1")); test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - + } +#if TEST_STD_VER >= 11 + { + typedef std::string S; test1(S(""), '1', S("1")); test1(S("abcde"), '1', S("abcde1")); test1(S("abcdefghij"), '1', S("abcdefghij1")); test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if TEST_STD_VER >= 11 - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; + } + { + typedef std::basic_string<char, std::char_traits<char>, + min_allocator<char> > + S; test0(S(""), '1', S("1")); test0(S("abcde"), '1', S("abcde1")); test0(S("abcdefghij"), '1', S("abcdefghij1")); test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - test1(S(""), '1', S("1")); test1(S("abcde"), '1', S("abcde1")); test1(S("abcdefghij"), '1', S("abcdefghij1")); test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } + } #endif } diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp index 3b669e7d9869..a9aa92f37e4e 100644 --- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp @@ -21,29 +21,23 @@ #include <utility> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> -void -test0(const S& lhs, const typename S::value_type* rhs, const S& x) -{ - assert(lhs + rhs == x); +void test0(const S& lhs, const typename S::value_type* rhs, const S& x) { + assert(lhs + rhs == x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#if TEST_STD_VER >= 11 template <class S> -void -test1(S&& lhs, const typename S::value_type* rhs, const S& x) -{ - assert(move(lhs) + rhs == x); +void test1(S&& lhs, const typename S::value_type* rhs, const S& x) { + assert(move(lhs) + rhs == x); } +#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -int main() -{ - { +int main() { + { typedef std::string S; test0(S(""), "", S("")); test0(S(""), "12345", S("12345")); @@ -56,14 +50,18 @@ int main() test0(S("abcdefghij"), "", S("abcdefghij")); test0(S("abcdefghij"), "12345", S("abcdefghij12345")); test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); + test0(S("abcdefghij"), "12345678901234567890", + S("abcdefghij12345678901234567890")); test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - + test0(S("abcdefghijklmnopqrst"), "1234567890", + S("abcdefghijklmnopqrst1234567890")); + test0(S("abcdefghijklmnopqrst"), "12345678901234567890", + S("abcdefghijklmnopqrst12345678901234567890")); + } +#if TEST_STD_VER >= 11 + { + typedef std::string S; test1(S(""), "", S("")); test1(S(""), "12345", S("12345")); test1(S(""), "1234567890", S("1234567890")); @@ -75,17 +73,19 @@ int main() test1(S("abcdefghij"), "", S("abcdefghij")); test1(S("abcdefghij"), "12345", S("abcdefghij12345")); test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); + test1(S("abcdefghij"), "12345678901234567890", + S("abcdefghij12345678901234567890")); test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if TEST_STD_VER >= 11 - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; + test1(S("abcdefghijklmnopqrst"), "1234567890", + S("abcdefghijklmnopqrst1234567890")); + test1(S("abcdefghijklmnopqrst"), "12345678901234567890", + S("abcdefghijklmnopqrst12345678901234567890")); + } + { + typedef std::basic_string<char, std::char_traits<char>, + min_allocator<char> > + S; test0(S(""), "", S("")); test0(S(""), "12345", S("12345")); test0(S(""), "1234567890", S("1234567890")); @@ -97,13 +97,14 @@ int main() test0(S("abcdefghij"), "", S("abcdefghij")); test0(S("abcdefghij"), "12345", S("abcdefghij12345")); test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); + test0(S("abcdefghij"), "12345678901234567890", + S("abcdefghij12345678901234567890")); test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + test0(S("abcdefghijklmnopqrst"), "1234567890", + S("abcdefghijklmnopqrst1234567890")); + test0(S("abcdefghijklmnopqrst"), "12345678901234567890", + S("abcdefghijklmnopqrst12345678901234567890")); test1(S(""), "", S("")); test1(S(""), "12345", S("12345")); @@ -116,13 +117,14 @@ int main() test1(S("abcdefghij"), "", S("abcdefghij")); test1(S("abcdefghij"), "12345", S("abcdefghij12345")); test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890")); - test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890")); + test1(S("abcdefghij"), "12345678901234567890", + S("abcdefghij12345678901234567890")); test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst")); test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } + test1(S("abcdefghijklmnopqrst"), "1234567890", + S("abcdefghijklmnopqrst1234567890")); + test1(S("abcdefghijklmnopqrst"), "12345678901234567890", + S("abcdefghijklmnopqrst12345678901234567890")); + } #endif } diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp index 1977b6f517ba..fbef64627341 100644 --- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp +++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp @@ -33,43 +33,34 @@ #include <utility> #include <cassert> +#include "test_macros.h" #include "min_allocator.h" template <class S> -void -test0(const S& lhs, const S& rhs, const S& x) -{ - assert(lhs + rhs == x); +void test0(const S& lhs, const S& rhs, const S& x) { + assert(lhs + rhs == x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#if TEST_STD_VER >= 11 template <class S> -void -test1(S&& lhs, const S& rhs, const S& x) -{ - assert(move(lhs) + rhs == x); +void test1(S&& lhs, const S& rhs, const S& x) { + assert(move(lhs) + rhs == x); } template <class S> -void -test2(const S& lhs, S&& rhs, const S& x) -{ - assert(lhs + move(rhs) == x); +void test2(const S& lhs, S&& rhs, const S& x) { + assert(lhs + move(rhs) == x); } template <class S> -void -test3(S&& lhs, S&& rhs, const S& x) -{ - assert(move(lhs) + move(rhs) == x); +void test3(S&& lhs, S&& rhs, const S& x) { + assert(move(lhs) + move(rhs) == x); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif -int main() -{ - { +int main() { + { typedef std::string S; test0(S(""), S(""), S("")); test0(S(""), S("12345"), S("12345")); @@ -78,18 +69,24 @@ int main() test0(S("abcde"), S(""), S("abcde")); test0(S("abcde"), S("12345"), S("abcde12345")); test0(S("abcde"), S("1234567890"), S("abcde1234567890")); - test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test0(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test0(S("abcdefghij"), S(""), S("abcdefghij")); test0(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test0(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - + test0(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test0(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } +#if TEST_STD_VER >= 11 + { + typedef std::string S; test1(S(""), S(""), S("")); test1(S(""), S("12345"), S("12345")); test1(S(""), S("1234567890"), S("1234567890")); @@ -97,15 +94,20 @@ int main() test1(S("abcde"), S(""), S("abcde")); test1(S("abcde"), S("12345"), S("abcde12345")); test1(S("abcde"), S("1234567890"), S("abcde1234567890")); - test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test1(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test1(S("abcdefghij"), S(""), S("abcdefghij")); test1(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test1(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); + test1(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test1(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test2(S(""), S(""), S("")); test2(S(""), S("12345"), S("12345")); @@ -114,15 +116,20 @@ int main() test2(S("abcde"), S(""), S("abcde")); test2(S("abcde"), S("12345"), S("abcde12345")); test2(S("abcde"), S("1234567890"), S("abcde1234567890")); - test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test2(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test2(S("abcdefghij"), S(""), S("abcdefghij")); test2(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test2(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); + test2(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test2(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test3(S(""), S(""), S("")); test3(S(""), S("12345"), S("12345")); @@ -131,21 +138,25 @@ int main() test3(S("abcde"), S(""), S("abcde")); test3(S("abcde"), S("12345"), S("abcde12345")); test3(S("abcde"), S("1234567890"), S("abcde1234567890")); - test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test3(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test3(S("abcdefghij"), S(""), S("abcdefghij")); test3(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test3(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#if TEST_STD_VER >= 11 - { - typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; + test3(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test3(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } + { + typedef std::basic_string<char, std::char_traits<char>, + min_allocator<char> > + S; test0(S(""), S(""), S("")); test0(S(""), S("12345"), S("12345")); test0(S(""), S("1234567890"), S("1234567890")); @@ -153,17 +164,20 @@ int main() test0(S("abcde"), S(""), S("abcde")); test0(S("abcde"), S("12345"), S("abcde12345")); test0(S("abcde"), S("1234567890"), S("abcde1234567890")); - test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test0(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test0(S("abcdefghij"), S(""), S("abcdefghij")); test0(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test0(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + test0(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test0(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test1(S(""), S(""), S("")); test1(S(""), S("12345"), S("12345")); @@ -172,15 +186,20 @@ int main() test1(S("abcde"), S(""), S("abcde")); test1(S("abcde"), S("12345"), S("abcde12345")); test1(S("abcde"), S("1234567890"), S("abcde1234567890")); - test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test1(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test1(S("abcdefghij"), S(""), S("abcdefghij")); test1(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test1(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); + test1(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test1(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test2(S(""), S(""), S("")); test2(S(""), S("12345"), S("12345")); @@ -189,15 +208,20 @@ int main() test2(S("abcde"), S(""), S("abcde")); test2(S("abcde"), S("12345"), S("abcde12345")); test2(S("abcde"), S("1234567890"), S("abcde1234567890")); - test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test2(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test2(S("abcdefghij"), S(""), S("abcdefghij")); test2(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test2(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); + test2(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test2(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); test3(S(""), S(""), S("")); test3(S(""), S("12345"), S("12345")); @@ -206,17 +230,20 @@ int main() test3(S("abcde"), S(""), S("abcde")); test3(S("abcde"), S("12345"), S("abcde12345")); test3(S("abcde"), S("1234567890"), S("abcde1234567890")); - test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890")); + test3(S("abcde"), S("12345678901234567890"), + S("abcde12345678901234567890")); test3(S("abcdefghij"), S(""), S("abcdefghij")); test3(S("abcdefghij"), S("12345"), S("abcdefghij12345")); test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890")); - test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890")); + test3(S("abcdefghij"), S("12345678901234567890"), + S("abcdefghij12345678901234567890")); test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst")); - test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345")); - test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890")); - test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890")); - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - } -#endif + test3(S("abcdefghijklmnopqrst"), S("12345"), + S("abcdefghijklmnopqrst12345")); + test3(S("abcdefghijklmnopqrst"), S("1234567890"), + S("abcdefghijklmnopqrst1234567890")); + test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), + S("abcdefghijklmnopqrst12345678901234567890")); + } +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp index 245c480885b8..a0071cd6594e 100644 --- a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp @@ -188,7 +188,7 @@ int main() } } #endif -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 { L0 l0; L0 l1; @@ -518,5 +518,5 @@ int main() } } #endif // TEST_HAS_NO_EXCEPTIONS -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp index fb563cbe0b14..4ad7a3ac2853 100644 --- a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp @@ -126,7 +126,7 @@ int main() } } #endif -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 { L0 l0; L0 l1; @@ -522,5 +522,5 @@ int main() assert(!l2.locked()); assert(!l3.locked()); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp index 138b657196da..dfd2f10b79e2 100644 --- a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp +++ b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp @@ -66,7 +66,7 @@ void f3() #endif } -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 struct init1 { @@ -101,7 +101,7 @@ void f2() std::call_once(flg2, init2(), 4, 5); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // TEST_STD_VER >= 11 std::once_flag flg41; std::once_flag flg42; @@ -135,7 +135,7 @@ void f42() std::call_once(flg41, init41); } -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 class MoveOnly { @@ -174,7 +174,6 @@ public: void operator()(int&) {} }; -#if TEST_STD_VER >= 11 // reference qualifiers on functions are a C++11 extension struct RefQual { @@ -185,8 +184,8 @@ struct RefQual void operator()() & { ++lv_called; } void operator()() && { ++rv_called; } }; -#endif -#endif + +#endif // TEST_STD_VER >= 11 int main() { @@ -218,7 +217,7 @@ int main() assert(init41_called == 1); assert(init42_called == 1); } -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 // check functors with 1 arg { std::thread t0(f1); @@ -245,7 +244,6 @@ int main() int i = 0; std::call_once(f, NonCopyable(), i); } -#if TEST_STD_VER >= 11 // reference qualifiers on functions are a C++11 extension { std::once_flag f1, f2; @@ -255,6 +253,5 @@ int main() std::call_once(f2, std::move(rq)); assert(rq.rv_called == 1); } -#endif -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // TEST_STD_VER >= 11 } diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp index 6995f0648335..21011ed17cd9 100644 --- a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp +++ b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp @@ -14,13 +14,14 @@ // constexpr once_flag() noexcept; #include <mutex> +#include "test_macros.h" int main() { { std::once_flag f; } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::once_flag f; } diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp index fc346d4dce7d..78b04d8615b3 100644 --- a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp +++ b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp @@ -50,7 +50,7 @@ namespace std { template <class T> struct hash<::min_pointer<T, std::integral_constant<size_t, 1>>> { - size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const noexcept(false) { + size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE { if (!p) return 0; return std::hash<T*>{}(std::addressof(*p)); } @@ -67,12 +67,16 @@ int main() int* ptr = new int; std::unique_ptr<int> p(ptr); std::hash<std::unique_ptr<int> > f; - ASSERT_NOT_NOEXCEPT(f(p)); std::size_t h = f(p); assert(h == std::hash<int*>()(ptr)); } #if TEST_STD_VER >= 11 { + std::unique_ptr<int, PointerDeleter<int, 1>> pThrowingHash; + std::hash<std::unique_ptr<int, PointerDeleter<int, 1>>> fThrowingHash; + ASSERT_NOT_NOEXCEPT(fThrowingHash(pThrowingHash)); + } + { test_enabled_with_deleter<int, Deleter<int>>(); test_enabled_with_deleter<int[], Deleter<int[]>>(); test_enabled_with_deleter<int, CopyDeleter<int>>(); diff --git a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp index 51a837e4e032..bf8aa0453e97 100644 --- a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp +++ b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp @@ -22,11 +22,11 @@ int main() static_assert(_5::value == 5, ""); static_assert((std::is_same<_5::value_type, int>::value), ""); static_assert((std::is_same<_5::type, _5>::value), ""); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 static_assert((_5() == 5), ""); -#else - assert(_5() == 5); #endif + assert(_5() == 5); + #if TEST_STD_VER > 11 static_assert ( _5{}() == 5, "" ); diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp index 43f23f5ccc80..883548270469 100644 --- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp +++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // type_traits // aligned_union<size_t Len, class ...Types> @@ -17,7 +19,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_VARIADICS { typedef std::aligned_union<10, char >::type T1; #if TEST_STD_VER > 11 @@ -90,5 +91,4 @@ int main() static_assert(std::alignment_of<T1>::value == 4, ""); static_assert(sizeof(T1) == 4, ""); } -#endif } diff --git a/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp index 29fb7a8431f1..dc69739271b5 100644 --- a/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator==(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator==(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator==(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator==(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp index ae34eb20517e..e1bad12e3f69 100644 --- a/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator>(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator>(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator>(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator>(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp index dac94002661f..342ddffc2c79 100644 --- a/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator>=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator>=(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator>=(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator>=(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp index b71f8363b0a6..bcf6afcc6bfb 100644 --- a/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator<=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator<=(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator<=(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator<=(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp index 84456b3baa6e..3d5e2144a967 100644 --- a/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator<(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator<(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator<(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator<(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp index a4ffdc25e721..7da9b7ba7a03 100644 --- a/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp +++ b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp @@ -10,8 +10,8 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator!=(const optional<T>& x, const T& v); -// template <class T> constexpr bool operator!=(const T& v, const optional<T>& x); +// template <class T, class U> constexpr bool operator!=(const optional<T>& x, const U& v); +// template <class T, class U> constexpr bool operator!=(const U& v, const optional<T>& x); #include <optional> diff --git a/test/std/utilities/optional/optional.hash/hash.pass.cpp b/test/std/utilities/optional/optional.hash/hash.pass.cpp index 8c91d6da761e..b4a1832cdc0a 100644 --- a/test/std/utilities/optional/optional.hash/hash.pass.cpp +++ b/test/std/utilities/optional/optional.hash/hash.pass.cpp @@ -26,7 +26,7 @@ namespace std { template <> struct hash<B> { - size_t operator()(B const&) noexcept(false) { return 0; } + size_t operator()(B const&) TEST_NOEXCEPT_FALSE { return 0; } }; } @@ -37,10 +37,16 @@ int main() const std::size_t nullopt_hash = std::hash<optional<double>>{}(optional<double>{}); + + { + optional<B> opt; + ASSERT_NOT_NOEXCEPT(std::hash<optional<B>>()(opt)); + ASSERT_NOT_NOEXCEPT(std::hash<optional<const B>>()(opt)); + } + { typedef int T; optional<T> opt; - ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt)); assert(std::hash<optional<T>>{}(opt) == nullopt_hash); opt = 2; assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); @@ -48,7 +54,6 @@ int main() { typedef std::string T; optional<T> opt; - ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt)); assert(std::hash<optional<T>>{}(opt) == nullopt_hash); opt = std::string("123"); assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); @@ -56,7 +61,6 @@ int main() { typedef std::unique_ptr<int> T; optional<T> opt; - ASSERT_NOT_NOEXCEPT(std::hash<optional<T>>()(opt)); assert(std::hash<optional<T>>{}(opt) == nullopt_hash); opt = std::unique_ptr<int>(new int(3)); assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); diff --git a/test/std/utilities/optional/optional.relops/equal.pass.cpp b/test/std/utilities/optional/optional.relops/equal.pass.cpp index 7667540f9760..0752841d3668 100644 --- a/test/std/utilities/optional/optional.relops/equal.pass.cpp +++ b/test/std/utilities/optional/optional.relops/equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator==(const optional<T>& x, const optional<U>& y); #include <optional> #include <type_traits> diff --git a/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp index 0e05834c147a..f475f3796916 100644 --- a/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp +++ b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator>= (const optional<T>& x, const optional<U>& y); #include <optional> diff --git a/test/std/utilities/optional/optional.relops/greater_than.pass.cpp b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp index 3946a6102ba9..c3f2af9323ab 100644 --- a/test/std/utilities/optional/optional.relops/greater_than.pass.cpp +++ b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator> (const optional<T>& x, const optional<U>& y); #include <optional> diff --git a/test/std/utilities/optional/optional.relops/less_equal.pass.cpp b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp index 5a1954154f44..35e80d3d4e50 100644 --- a/test/std/utilities/optional/optional.relops/less_equal.pass.cpp +++ b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator<= (const optional<T>& x, const optional<U>& y); #include <optional> diff --git a/test/std/utilities/optional/optional.relops/less_than.pass.cpp b/test/std/utilities/optional/optional.relops/less_than.pass.cpp index 35956e6f4a70..1dbffbd92352 100644 --- a/test/std/utilities/optional/optional.relops/less_than.pass.cpp +++ b/test/std/utilities/optional/optional.relops/less_than.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator< (const optional<T>& x, const optional<U>& y); #include <optional> diff --git a/test/std/utilities/optional/optional.relops/not_equal.pass.cpp b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp index 1256537d6a86..12d9922a9592 100644 --- a/test/std/utilities/optional/optional.relops/not_equal.pass.cpp +++ b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp @@ -10,7 +10,7 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // <optional> -// template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y); +// template <class T, class U> constexpr bool operator!=(const optional<T>& x, const optional<U>& y); #include <optional> #include <type_traits> diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp index 9b946a733fea..716a2b92a96c 100644 --- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp +++ b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp @@ -78,14 +78,11 @@ void test_sfinae() { using DA = NCConvertingDeleter<A[]>; // non-copyable deleters using DAC = NCConvertingDeleter<const A[]>; // non-copyable deleters - using DB = NCConvertingDeleter<B[]>; using UA = std::unique_ptr<A[]>; using UAC = std::unique_ptr<const A[]>; - using UB = std::unique_ptr<B[]>; using UAD = std::unique_ptr<A[], DA>; using UACD = std::unique_ptr<const A[], DAC>; - using UBD = std::unique_ptr<B[], DB>; { // cannot move from an lvalue static_assert(std::is_assignable<UAC, UA&&>::value, ""); static_assert(!std::is_assignable<UAC, UA&>::value, ""); diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp index 51d9aa708c40..2a7949f6420a 100644 --- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp +++ b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp @@ -46,7 +46,7 @@ struct NonDefaultDeleter { template <class ElemType> void test_sfinae() { #if TEST_STD_VER >= 11 - { // the constructor does not participate in overload resultion when + { // the constructor does not participate in overload resolution when // the deleter is a pointer type using U = std::unique_ptr<ElemType, void (*)(void*)>; static_assert(!std::is_default_constructible<U>::value, ""); diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp index 6e5db86c97fc..769deea92c85 100644 --- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp +++ b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp @@ -19,6 +19,7 @@ #include <cassert> #include "test_macros.h" +#include "type_id.h" #include "unique_ptr_test_helper.h" template <int ID = 0> @@ -33,9 +34,71 @@ struct GenericConvertingDeleter { void operator()(void*) const {} }; +template <class Templ, class Other> +struct is_specialization; + +template <template <int> class Templ, int ID1, class Other> +struct is_specialization<Templ<ID1>, Other> : std::false_type {}; + +template <template <int> class Templ, int ID1, int ID2> +struct is_specialization<Templ<ID1>, Templ<ID2> > : std::true_type {}; + +template <class Templ, class Other> +using EnableIfSpecialization = typename std::enable_if< + is_specialization<Templ, typename std::decay<Other>::type >::value + >::type; + + +template <int ID> +struct TrackingDeleter { + TrackingDeleter() : arg_type(&makeArgumentID<>()) {} + + TrackingDeleter(TrackingDeleter const&) + : arg_type(&makeArgumentID<TrackingDeleter const&>()) {} + + TrackingDeleter(TrackingDeleter&&) + : arg_type(&makeArgumentID<TrackingDeleter &&>()) {} + + template <class T, class = EnableIfSpecialization<TrackingDeleter, T> > + TrackingDeleter(T&&) : arg_type(&makeArgumentID<T&&>()) {} + + TrackingDeleter& operator=(TrackingDeleter const&) { + arg_type = &makeArgumentID<TrackingDeleter const&>(); + return *this; + } + + TrackingDeleter& operator=(TrackingDeleter &&) { + arg_type = &makeArgumentID<TrackingDeleter &&>(); + return *this; + } + + template <class T, class = EnableIfSpecialization<TrackingDeleter, T> > + TrackingDeleter& operator=(T&&) { + arg_type = &makeArgumentID<T&&>(); + return *this; + } + + void operator()(void*) const {} + +public: + TypeID const* reset() const { + TypeID const* tmp = arg_type; + arg_type = nullptr; + return tmp; + } + + mutable TypeID const* arg_type; +}; + + +template <class ExpectT, int ID> +bool checkArg(TrackingDeleter<ID> const& d) { + return d.arg_type && *d.arg_type == makeArgumentID<ExpectT>(); +} + + template <bool IsArray> void test_sfinae() { -#if TEST_STD_VER >= 11 typedef typename std::conditional<IsArray, A[], A>::type VT; { // Test that different non-reference deleter types are allowed so long @@ -80,13 +143,11 @@ void test_sfinae() { static_assert(std::is_constructible<U1, U5&&>::value, ""); static_assert(std::is_constructible<U1, U6&&>::value, ""); } -#endif } template <bool IsArray> void test_noexcept() { -#if TEST_STD_VER >= 11 typedef typename std::conditional<IsArray, A[], A>::type VT; { typedef std::unique_ptr<const VT> APtr; @@ -108,7 +169,39 @@ void test_noexcept() { typedef std::unique_ptr<VT, const NCConstDeleter<const VT>&> BPtr; static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, ""); } -#endif +} + + +template <bool IsArray> +void test_deleter_value_category() { + typedef typename std::conditional<IsArray, A[], A>::type VT; + using TD1 = TrackingDeleter<1>; + using TD2 = TrackingDeleter<2>; + TD1 d1; + TD2 d2; + + { // Test non-reference deleter conversions + using U1 = std::unique_ptr<VT, TD1 >; + using U2 = std::unique_ptr<VT, TD2 >; + U2 u2; + u2.get_deleter().reset(); + U1 u1(std::move(u2)); + assert(checkArg<TD2&&>(u1.get_deleter())); + } + { // Test assignment from non-const ref + using U1 = std::unique_ptr<VT, TD1 >; + using U2 = std::unique_ptr<VT, TD2& >; + U2 u2(nullptr, d2); + U1 u1(std::move(u2)); + assert(checkArg<TD2&>(u1.get_deleter())); + } + { // Test assignment from const ref + using U1 = std::unique_ptr<VT, TD1 >; + using U2 = std::unique_ptr<VT, TD2 const& >; + U2 u2(nullptr, d2); + U1 u1(std::move(u2)); + assert(checkArg<TD2 const&>(u1.get_deleter())); + } } @@ -116,9 +209,11 @@ int main() { { test_sfinae</*IsArray*/false>(); test_noexcept<false>(); + test_deleter_value_category<false>(); } { test_sfinae</*IsArray*/true>(); test_noexcept<true>(); + test_deleter_value_category<true>(); } } diff --git a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp index b85f039526a4..37753bcad0d1 100644 --- a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp @@ -16,7 +16,7 @@ #include <chrono> #include <cassert> -#include <test_macros.h> +#include "test_macros.h" int main() { diff --git a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp index 347cc1980e81..f932eb51c0d5 100644 --- a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp @@ -16,7 +16,7 @@ #include <chrono> #include <cassert> -#include <test_macros.h> +#include "test_macros.h" int main() { diff --git a/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp index 1c87fcd909ef..9ecdfc750ab0 100644 --- a/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp @@ -20,6 +20,8 @@ #include <type_traits> #include <cassert> +#include "test_macros.h" + template <class ToDuration, class FromDuration> void test(const FromDuration& f, const ToDuration& d) @@ -43,7 +45,7 @@ int main() std::chrono::duration<double, std::ratio<3600> >(7265./3600)); test(std::chrono::duration<int, std::ratio<2, 3> >(9), std::chrono::duration<int, std::ratio<3, 5> >(10)); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::hours h = std::chrono::duration_cast<std::chrono::hours>(std::chrono::milliseconds(7265000)); static_assert(h.count() == 2, ""); diff --git a/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp b/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp index 2d0dd94d4cf6..5adc62ff1c5f 100644 --- a/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp @@ -24,6 +24,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -68,7 +70,7 @@ int main() assert(s1 == s2); assert(!(s1 != s2)); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::seconds s1(3); constexpr std::chrono::seconds s2(3); diff --git a/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp b/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp index 9d875579f326..42e798254208 100644 --- a/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp @@ -34,6 +34,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -92,7 +94,7 @@ int main() assert( (s1 <= s2)); assert( (s1 >= s2)); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::seconds s1(3); constexpr std::chrono::seconds s2(3); diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp index 152227d82a82..c237fd7716f3 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() std::chrono::microseconds us = ms; assert(us.count() == 1000); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::milliseconds ms(1); constexpr std::chrono::microseconds us = ms; diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp index 519b2b141c29..4b5042df2ce2 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() std::chrono::duration<double, std::milli> ms = us; assert(ms.count() == 1./1000); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::duration<double, std::micro> us(1); constexpr std::chrono::duration<double, std::milli> ms = us; diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp index 59fefe2e002d..8e5938b9e4b3 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() std::chrono::duration<double, std::milli> d = i; assert(d.count() == 3000); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::duration<int> i(3); constexpr std::chrono::duration<double, std::milli> d = i; diff --git a/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp index c52990961c25..4f7d67bb630c 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp @@ -18,6 +18,7 @@ #include <chrono> #include <cassert> +#include "test_macros.h" #include "../../rep.h" template <class D> @@ -26,7 +27,7 @@ test() { D d; assert(d.count() == typename D::rep()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 constexpr D d2 = D(); static_assert(d2.count() == typename D::rep(), ""); #endif diff --git a/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp index 20f81619bd12..6ad743e714c2 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp @@ -17,6 +17,7 @@ #include <chrono> #include <cassert> +#include "test_macros.h" #include "../../rep.h" template <class D, class R> @@ -25,7 +26,7 @@ test(R r) { D d(r); assert(d.count() == r); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 constexpr D d2(R(2)); static_assert(d2.count() == 2, ""); #endif diff --git a/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp index b3ba9f7081e4..ae745a76f431 100644 --- a/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp @@ -19,11 +19,13 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { std::chrono::duration<double> d(5); assert(d.count() == 5); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 constexpr std::chrono::duration<double> d2(5); static_assert(d2.count() == 5, ""); #endif diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp index 6585351cb4c8..6859ffcb208a 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp @@ -18,6 +18,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -44,7 +46,7 @@ int main() std::chrono::duration<double, std::ratio<1, 15> > r = s1 + s2; assert(r.count() == 75); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::seconds s1(3); constexpr std::chrono::seconds s2(5); diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp index fac58b9716d3..4bf26e4288b7 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -45,7 +47,7 @@ int main() std::chrono::duration<double, std::ratio<1, 15> > r = s1 - s2; assert(r.count() == -15); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::seconds s1(3); constexpr std::chrono::seconds s2(5); diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp index 6b24676f100c..561516b66511 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -41,7 +43,7 @@ int main() std::chrono::duration<double, std::ratio<3, 5> > s2(5); assert(s1 / s2 == 20./3); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::nanoseconds ns1(15); constexpr std::chrono::nanoseconds ns2(5); diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp index 3036cde5bf67..8b667e84d4d7 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() ns = ns / 5; assert(ns.count() == 3); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::nanoseconds ns(15); constexpr std::chrono::nanoseconds ns2 = ns / 5; diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp index e69f3205d14f..441b053dc521 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -39,7 +41,7 @@ int main() std::chrono::duration<int, std::ratio<1, 15> > r = s1 % s2; assert(r.count() == 24); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::nanoseconds ns1(15); constexpr std::chrono::nanoseconds ns2(6); diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp index 1acbe34ea5eb..537fae373930 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp @@ -19,6 +19,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -26,7 +28,7 @@ int main() ns = ns % 6; assert(ns.count() == 3); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::nanoseconds ns(15); constexpr std::chrono::nanoseconds ns2 = ns % 6; diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp index 190e74b1dc32..6b8c83732127 100644 --- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp @@ -24,6 +24,8 @@ #include <chrono> #include <cassert> +#include "test_macros.h" + int main() { { @@ -33,7 +35,7 @@ int main() ns = 6 * ns; assert(ns.count() == 90); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { constexpr std::chrono::nanoseconds ns(3); constexpr std::chrono::nanoseconds ns2 = ns * 5; diff --git a/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp index 405461e88ae9..48c3e86e8101 100644 --- a/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp @@ -17,6 +17,7 @@ #include <limits> #include <cassert> +#include "test_macros.h" #include "../../rep.h" template <class D> @@ -27,7 +28,7 @@ void test() Rep max_rep = std::chrono::duration_values<Rep>::max(); assert(D::max().count() == max_rep); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { typedef typename D::rep Rep; constexpr Rep max_rep = std::chrono::duration_values<Rep>::max(); diff --git a/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp index 44cd64eff3d3..0d94aaa5869c 100644 --- a/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp @@ -17,6 +17,7 @@ #include <limits> #include <cassert> +#include "test_macros.h" #include "../../rep.h" template <class D> @@ -27,7 +28,7 @@ void test() Rep min_rep = std::chrono::duration_values<Rep>::min(); assert(D::min().count() == min_rep); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { typedef typename D::rep Rep; constexpr Rep min_rep = std::chrono::duration_values<Rep>::min(); diff --git a/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp index 18350fe2ff47..7b312c5acb50 100644 --- a/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp +++ b/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp @@ -16,6 +16,7 @@ #include <chrono> #include <cassert> +#include "test_macros.h" #include "../../rep.h" template <class D> @@ -26,7 +27,7 @@ void test() Rep zero_rep = std::chrono::duration_values<Rep>::zero(); assert(D::zero().count() == zero_rep); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 { typedef typename D::rep Rep; constexpr Rep zero_rep = std::chrono::duration_values<Rep>::zero(); diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp index 89dc1dcc1a59..e3754c1f6475 100644 --- a/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp +++ b/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp @@ -15,6 +15,7 @@ #include <limits> #include <cassert> +#include "test_macros.h" #include "../../rep.h" int main() @@ -25,7 +26,7 @@ int main() std::numeric_limits<double>::max()); assert(std::chrono::duration_values<Rep>::max() == std::numeric_limits<Rep>::max()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 static_assert(std::chrono::duration_values<int>::max() == std::numeric_limits<int>::max(), ""); static_assert(std::chrono::duration_values<double>::max() == diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp index 69812bba006a..508837375b87 100644 --- a/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp +++ b/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp @@ -15,6 +15,7 @@ #include <limits> #include <cassert> +#include "test_macros.h" #include "../../rep.h" int main() @@ -25,7 +26,7 @@ int main() std::numeric_limits<double>::lowest()); assert(std::chrono::duration_values<Rep>::min() == std::numeric_limits<Rep>::lowest()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 static_assert(std::chrono::duration_values<int>::min() == std::numeric_limits<int>::lowest(), ""); static_assert(std::chrono::duration_values<double>::min() == diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp index 234b4bc31c9d..b84a676738a8 100644 --- a/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp +++ b/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp @@ -14,13 +14,14 @@ #include <chrono> #include <cassert> +#include "test_macros.h" #include "../../rep.h" int main() { assert(std::chrono::duration_values<int>::zero() == 0); assert(std::chrono::duration_values<Rep>::zero() == 0); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#if TEST_STD_VER >= 11 static_assert(std::chrono::duration_values<int>::zero() == 0, ""); static_assert(std::chrono::duration_values<Rep>::zero() == 0, ""); #endif 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 eeaa8a24ee68..fa2f116f7718 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 @@ -86,7 +86,6 @@ int main() static_assert(!noexcept(std::tuple<NoExceptDefault, ThrowingDefault>()), ""); static_assert(!noexcept(std::tuple<ThrowingDefault, ThrowingDefault>()), ""); } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR { constexpr std::tuple<> t; } @@ -106,5 +105,4 @@ int main() IllFormedDefault v(0); std::tuple<IllFormedDefault> t(v); } -#endif } diff --git a/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp b/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp index 90476bcde28c..12968de2dd47 100644 --- a/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp +++ b/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <utility> // template <class T1, class T2> struct pair @@ -42,7 +44,6 @@ public: int main() { -#ifndef _LIBCPP_HAS_NO_VARIADICS std::pair<A, B> p(std::piecewise_construct, std::make_tuple(4, 'a'), std::make_tuple(3.5, 6u, 2u)); @@ -51,5 +52,4 @@ int main() assert(p.second.get_d() == 3.5); assert(p.second.get_u1() == 6u); assert(p.second.get_u2() == 2u); -#endif } diff --git a/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp index 42a2666dd04b..c738adad7d79 100644 --- a/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp +++ b/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <utility> // template <class T1, class T2> struct pair @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_VARIADICS { typedef std::pair<int, int*> P1; typedef std::pair<int*, int> P2; @@ -31,5 +32,4 @@ int main() assert(p3.first == P1(3, nullptr)); assert(p3.second == P2(nullptr, 4)); } -#endif // _LIBCPP_HAS_NO_VARIADICS } |