diff --git a/libcxx/include/vector b/libcxx/include/vector index 8f404dc4211e..6759dbd8a584 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -527,12 +527,7 @@ public: is_constructible< value_type, typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY - vector(initializer_list __il); - _LIBCPP_INLINE_VISIBILITY - vector(initializer_list __il, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_INLINE_VISIBILITY ~vector() @@ -545,7 +540,14 @@ public: vector(const vector& __x, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY vector& operator=(const vector& __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + vector(initializer_list __il); + + _LIBCPP_INLINE_VISIBILITY + vector(initializer_list __il, const allocator_type& __a); + _LIBCPP_INLINE_VISIBILITY vector(vector&& __x) #if _LIBCPP_STD_VER > 14 @@ -553,17 +555,18 @@ public: #else _NOEXCEPT_(is_nothrow_move_constructible::value); #endif + _LIBCPP_INLINE_VISIBILITY vector(vector&& __x, const allocator_type& __a); _LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __x) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + _LIBCPP_INLINE_VISIBILITY vector& operator=(initializer_list __il) {assign(__il.begin(), __il.end()); return *this;} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#endif // !_LIBCPP_CXX03_LANG template typename enable_if @@ -588,11 +591,12 @@ public: assign(_ForwardIterator __first, _ForwardIterator __last); void assign(size_type __n, const_reference __u); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void assign(initializer_list __il) {assign(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -676,9 +680,10 @@ public: {return _VSTD::__to_raw_pointer(this->__begin_);} _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); -#ifndef _LIBCPP_HAS_NO_VARIADICS + template _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 @@ -686,19 +691,19 @@ public: #else void emplace_back(_Args&&... __args); #endif -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY void pop_back(); iterator insert(const_iterator __position, const_reference __x); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#ifndef _LIBCPP_CXX03_LANG iterator insert(const_iterator __position, value_type&& __x); -#ifndef _LIBCPP_HAS_NO_VARIADICS template iterator emplace(const_iterator __position, _Args&&... __args); -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG + iterator insert(const_iterator __position, size_type __n, const_reference __x); template typename enable_if @@ -721,11 +726,12 @@ public: iterator >::type insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __position, initializer_list __il) {return insert(__position, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position); iterator erase(const_iterator __first, const_iterator __last); @@ -798,18 +804,16 @@ private: __base::__destruct_at_end(__new_last); __annotate_shrink(__old_size); } - template - void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - __push_back_slow_path(_Up&& __x); -#else - __push_back_slow_path(_Up& __x); -#endif -#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) + +#ifndef _LIBCPP_CXX03_LANG + template void __push_back_slow_path(_Up&& __x); + template - void - __emplace_back_slow_path(_Args&&... __args); + void __emplace_back_slow_path(_Args&&... __args); +#else + template void __push_back_slow_path(_Up& __x); #endif + // The following functions are no-ops outside of AddressSanitizer mode. // We call annotatations only for the default Allocator because other allocators // may not meet the AddressSanitizer alignment constraints. @@ -1219,7 +1223,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a) } } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY @@ -1266,8 +1270,6 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a) } } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(initializer_list __il) @@ -1297,8 +1299,6 @@ vector<_Tp, _Allocator>::vector(initializer_list __il, const allocat } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>& @@ -1340,7 +1340,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type) #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY @@ -1562,7 +1562,7 @@ vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT template template void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x) #else vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x) @@ -1593,7 +1593,7 @@ vector<_Tp, _Allocator>::push_back(const_reference __x) __push_back_slow_path(__x); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY @@ -1613,8 +1613,6 @@ vector<_Tp, _Allocator>::push_back(value_type&& __x) __push_back_slow_path(_VSTD::move(__x)); } -#ifndef _LIBCPP_HAS_NO_VARIADICS - template template void @@ -1654,8 +1652,7 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) #endif } -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG template inline @@ -1760,7 +1757,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x) return __make_iter(__p); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template typename vector<_Tp, _Allocator>::iterator @@ -1799,8 +1796,6 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) return __make_iter(__p); } -#ifndef _LIBCPP_HAS_NO_VARIADICS - template template typename vector<_Tp, _Allocator>::iterator @@ -1840,8 +1835,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) return __make_iter(__p); } -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG template typename vector<_Tp, _Allocator>::iterator @@ -2038,7 +2032,7 @@ vector<_Tp, _Allocator>::swap(vector& __x) _VSTD::swap(this->__begin_, __x.__begin_); _VSTD::swap(this->__end_, __x.__end_); _VSTD::swap(this->__end_cap(), __x.__end_cap()); - __swap_allocator(this->__alloc(), __x.__alloc(), + __swap_allocator(this->__alloc(), __x.__alloc(), integral_constant()); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->swap(this, &__x); @@ -2233,12 +2227,11 @@ public: vector(const vector& __v); vector(const vector& __v, const allocator_type& __a); vector& operator=(const vector& __v); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG vector(initializer_list __il); vector(initializer_list __il, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY vector(vector&& __v) #if _LIBCPP_STD_VER > 14 @@ -2250,12 +2243,12 @@ public: _LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __v) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + _LIBCPP_INLINE_VISIBILITY vector& operator=(initializer_list __il) {assign(__il.begin(), __il.end()); return *this;} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#endif // !_LIBCPP_CXX03_LANG template typename enable_if @@ -2274,11 +2267,12 @@ public: assign(_ForwardIterator __first, _ForwardIterator __last); void assign(size_type __n, const value_type& __x); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void assign(initializer_list __il) {assign(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT {return allocator_type(this->__alloc());} @@ -2387,11 +2381,12 @@ public: iterator >::type insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __position, initializer_list __il) {return insert(__position, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position); iterator erase(const_iterator __first, const_iterator __last); @@ -2751,7 +2746,7 @@ vector::vector(_ForwardIterator __first, _ForwardIterator __la } } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template vector::vector(initializer_list __il) @@ -2781,7 +2776,7 @@ vector::vector(initializer_list __il, const alloca } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template vector::~vector() @@ -2838,7 +2833,7 @@ vector::operator=(const vector& __v) return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template inline _LIBCPP_INLINE_VISIBILITY @@ -2913,7 +2908,7 @@ vector::__move_assign(vector& __c, true_type) __c.__cap() = __c.__size_ = 0; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // !_LIBCPP_CXX03_LANG template void @@ -3203,7 +3198,7 @@ vector::swap(vector& __x) _VSTD::swap(this->__begin_, __x.__begin_); _VSTD::swap(this->__size_, __x.__size_); _VSTD::swap(this->__cap(), __x.__cap()); - __swap_allocator(this->__alloc(), __x.__alloc(), + __swap_allocator(this->__alloc(), __x.__alloc(), integral_constant()); } diff --git a/libcxx/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp index ac7a2ce38adf..60146a88b3b5 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // void assign(initializer_list il); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d; d.assign({true, false, false, true}); @@ -28,7 +29,6 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#if TEST_STD_VER >= 11 { std::vector> d; d.assign({true, false, false, true}); @@ -38,6 +38,4 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp index f07c1d90059d..13cd65f33123 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector& operator=(vector&& c); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -61,7 +62,6 @@ int main() assert(l.empty()); assert(l2.get_allocator() == lo.get_allocator()); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -76,6 +76,4 @@ int main() assert(l.empty()); assert(l2.get_allocator() == lo.get_allocator()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp index 07bae0eb7089..a850fa2f1cdd 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(initializer_list il); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d = {true, false, false, true}; assert(d.size() == 4); @@ -27,7 +28,6 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#if TEST_STD_VER >= 11 { std::vector> d = {true, false, false, true}; assert(d.size() == 4); @@ -36,6 +36,4 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp index 5f7f5144f841..9a2df4290e77 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(initializer_list il, const Allocator& a = allocator_type()); @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector> d({true, false, false, true}, test_allocator(3)); assert(d.get_allocator() == test_allocator(3)); @@ -29,7 +30,6 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#if TEST_STD_VER >= 11 { std::vector> d({true, false, false, true}, min_allocator()); assert(d.get_allocator() == min_allocator()); @@ -39,6 +39,4 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp index 3a176d94e860..df4cb199b8fd 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // iterator insert(const_iterator p, initializer_list il); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d(10, true); std::vector::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false}); @@ -39,7 +40,6 @@ int main() assert(d[12] == true); assert(d[13] == true); } -#if TEST_STD_VER >= 11 { std::vector> d(10, true); std::vector>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false}); @@ -60,6 +60,4 @@ int main() assert(d[12] == true); assert(d[13] == true); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp index f3a11ec562c0..f189e2b97092 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(vector&& c); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -45,7 +46,6 @@ int main() assert(l.empty()); assert(l2.get_allocator() == lo.get_allocator()); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -59,6 +59,4 @@ int main() assert(l.empty()); assert(l2.get_allocator() == lo.get_allocator()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp index 7aaa7c55550b..b3b6f964966b 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(vector&& c, const allocator_type& a); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -58,7 +59,6 @@ int main() assert(!l.empty()); assert(l2.get_allocator() == other_allocator(4)); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -72,6 +72,4 @@ int main() assert(l.empty()); assert(l2.get_allocator() == min_allocator()); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp index 4b959cf00ad3..61874338d655 100644 --- a/libcxx/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector& operator=(initializer_list il); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d; d = {true, false, false, true}; @@ -28,7 +29,6 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#if TEST_STD_VER >= 11 { std::vector> d; d = {true, false, false, true}; @@ -38,6 +38,4 @@ int main() assert(d[2] == false); assert(d[3] == true); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp index 6409acaf65c1..273bdad9acdb 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp @@ -13,6 +13,8 @@ #include #include + +#include "test_macros.h" #include "test_allocator.h" #include "MoveOnly.h" #include "min_allocator.h" @@ -20,31 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - { - std::vector v(100); - v.resize(50); - assert(v.size() == 50); - assert(v.capacity() == 100); - assert(is_contiguous_container_asan_correct(v)); - v.resize(200); - assert(v.size() == 200); - assert(v.capacity() >= 200); - assert(is_contiguous_container_asan_correct(v)); - } - { - // Add 1 for implementations that dynamically allocate a container proxy. - std::vector > v(100); - v.resize(50); - assert(v.size() == 50); - assert(v.capacity() == 100); - assert(is_contiguous_container_asan_correct(v)); - v.resize(200); - assert(v.size() == 200); - assert(v.capacity() >= 200); - assert(is_contiguous_container_asan_correct(v)); - } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector v(100); v.resize(50); @@ -68,8 +45,30 @@ int main() assert(v.capacity() >= 200); assert(is_contiguous_container_asan_correct(v)); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #if TEST_STD_VER >= 11 + { + std::vector v(100); + v.resize(50); + assert(v.size() == 50); + assert(v.capacity() == 100); + assert(is_contiguous_container_asan_correct(v)); + v.resize(200); + assert(v.size() == 200); + assert(v.capacity() >= 200); + assert(is_contiguous_container_asan_correct(v)); + } + { + // Add 1 for implementations that dynamically allocate a container proxy. + std::vector > v(100); + v.resize(50); + assert(v.size() == 50); + assert(v.capacity() == 100); + assert(is_contiguous_container_asan_correct(v)); + v.resize(200); + assert(v.size() == 200); + assert(v.capacity() >= 200); + assert(is_contiguous_container_asan_correct(v)); + } { std::vector> v(100); v.resize(50); diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp index 222fa9c78f92..853f75583ddc 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // void assign(initializer_list il); @@ -20,7 +22,6 @@ template void test ( Vec &v ) { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS v.assign({3, 4, 5, 6}); assert(v.size() == 4); assert(is_contiguous_container_asan_correct(v)); @@ -28,7 +29,6 @@ void test ( Vec &v ) assert(v[1] == 4); assert(v[2] == 5); assert(v[3] == 6); -#endif } int main() @@ -41,8 +41,6 @@ int main() test(d1); test(d2); } - -#if TEST_STD_VER >= 11 { typedef std::vector> V; V d1; @@ -51,5 +49,4 @@ int main() test(d1); test(d2); } -#endif } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp index acbee97bcd1c..c2b6b83784f2 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector& operator=(vector&& c); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -76,7 +77,6 @@ int main() assert(l2.get_allocator() == lo.get_allocator()); assert(is_contiguous_container_asan_correct(l2)); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -96,6 +96,4 @@ int main() assert(l2.get_allocator() == lo.get_allocator()); assert(is_contiguous_container_asan_correct(l2)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp index 408bcc3b1499..edbad8c0d95b 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(initializer_list il); @@ -18,7 +20,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d = {3, 4, 5, 6}; assert(d.size() == 4); @@ -28,7 +29,6 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#if TEST_STD_VER >= 11 { std::vector> d = {3, 4, 5, 6}; assert(d.size() == 4); @@ -38,6 +38,4 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp index f4c3b5c1e8e0..ac5d0178e73a 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(initializer_list il, const Allocator& a = allocator_type()); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector> d({3, 4, 5, 6}, test_allocator(3)); assert(d.get_allocator() == test_allocator(3)); @@ -31,7 +32,6 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#if TEST_STD_VER >= 11 { std::vector> d({3, 4, 5, 6}, min_allocator()); assert(d.get_allocator() == min_allocator()); @@ -42,6 +42,4 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp index d51b364f3ba0..cd50d5432349 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(vector&& c); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -68,7 +69,6 @@ int main() assert(*j == 3); assert(is_contiguous_container_asan_correct(c2)); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -98,6 +98,4 @@ int main() assert(*j == 3); assert(is_contiguous_container_asan_correct(c2)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp index fcdd35ae1157..767a0ce3dce9 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector(vector&& c, const allocator_type& a); @@ -20,7 +22,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector > l(test_allocator(5)); std::vector > lo(test_allocator(5)); @@ -75,7 +76,6 @@ int main() assert(l2.get_allocator() == other_allocator(4)); assert(is_contiguous_container_asan_correct(l2)); } -#if TEST_STD_VER >= 11 { std::vector > l(min_allocator{}); std::vector > lo(min_allocator{}); @@ -94,6 +94,4 @@ int main() assert(l2.get_allocator() == min_allocator()); assert(is_contiguous_container_asan_correct(l2)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp index 4e5a20413683..21dd5c384b58 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // vector& operator=(initializer_list il); @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d; d = {3, 4, 5, 6}; @@ -30,7 +31,6 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#if TEST_STD_VER >= 11 { std::vector> d; d = {3, 4, 5, 6}; @@ -41,6 +41,4 @@ int main() assert(d[2] == 5); assert(d[3] == 6); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp index 7e4aed8c1b5e..e5e0277fa37a 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template iterator emplace(const_iterator pos, Args&&... args); @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector v; v.reserve(3); @@ -38,7 +39,6 @@ int main() assert(v[0] == 3); assert(is_contiguous_container_asan_correct(v)); } -#if TEST_STD_VER >= 11 { std::vector> v; v.reserve(3); @@ -57,6 +57,4 @@ int main() assert(v[0] == 3); assert(is_contiguous_container_asan_correct(v)); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp index b0fe123aac48..9072d427cab7 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // iterator insert(const_iterator p, initializer_list il); @@ -19,7 +21,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS { std::vector d(10, 1); std::vector::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6}); @@ -41,7 +42,6 @@ int main() assert(d[12] == 1); assert(d[13] == 1); } -#if TEST_STD_VER >= 11 { std::vector> d(10, 1); std::vector>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6}); @@ -63,6 +63,4 @@ int main() assert(d[12] == 1); assert(d[13] == 1); } -#endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp index f4a1f5d5f519..ac1fffd9d0d7 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // void push_back(value_type&& x); @@ -21,7 +23,6 @@ int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { std::vector c; c.push_back(MoveOnly(0)); @@ -81,7 +82,6 @@ int main() for (int j = 0; static_cast(j) < c.size(); ++j) assert(c[j] == MoveOnly(j)); } -#if TEST_STD_VER >= 11 { std::vector> c; c.push_back(MoveOnly(0)); @@ -110,6 +110,4 @@ int main() for (int j = 0; static_cast(j) < c.size(); ++j) assert(c[j] == MoveOnly(j)); } -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES }