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 | |
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
356 files changed, 2947 insertions, 2096 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ee1e52d2e6..d3bd533396b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,8 +64,12 @@ option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." O option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON) option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON) -option(LIBCXX_ENABLE_FILESYSTEM - "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) +set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY}) +if (WIN32) + set(ENABLE_FILESYSTEM_DEFAULT OFF) +endif() +option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a" + ${ENABLE_FILESYSTEM_DEFAULT}) option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) # Benchmark options ----------------------------------------------------------- diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000000..3cb2ce6f6bab --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,97 @@ +version: '{build}' + +shallow_clone: true + +os: + - Visual Studio 2015 + +build: + verbosity: detailed + +branches: + only: + - master + +configuration: + - Debug + +environment: + matrix: + - COMPILER: Clang-CL 4.0 + +install: + ############################################################################ + # All external dependencies are installed in C:\projects\deps + ############################################################################ + - mkdir C:\projects\deps + - cd C:\projects\deps + + ############################################################################ + # Install Ninja + ############################################################################ + - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip" + - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip + - 7z x ninja.zip -oC:\projects\deps\ninja > nul + - set PATH=C:\projects\deps\ninja;%PATH% + - ninja --version + + ############################################################################ + # Install a recent CMake + ############################################################################ + - set CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip" + - appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip + - 7z x cmake.zip -oC:\projects\deps > nul + - move C:\projects\deps\cmake-* C:\projects\deps\cmake # Move to a version-agnostic directory + - set PATH=C:\projects\deps\cmake\bin;%PATH% + - cmake --version + + ############################################################################ + # Setup the path to Clang-cl + ############################################################################ + - set PATH="C:\Program Files\LLVM\bin";%PATH% + - clang-cl -v + + ############################################################################ + # Setup the cached copy of LLVM + ############################################################################ + - if exist llvm (git -C llvm pull --rebase=true --ff-only) + - if not exist llvm (git clone --depth=1 http://llvm.org/git/llvm.git) + + +before_build: + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 + - cd C:\projects\libcxx + +build_script: + - md C:\projects\build-libcxx + - cd C:\projects\build-libcxx + - echo %configuration% + + ############################################################################# + # Configuration Step + ############################################################################# + - cmake -G Ninja %extra_cmake_flags% + -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe + "-DCMAKE_BUILD_TYPE=%configuration%" + "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLLVM_LIT_ARGS="-sv --no-progress-bar --show-xfail --show-unsupported" + C:\projects\libcxx + + ############################################################################# + # Build Step + ############################################################################# + - ninja + +test_script: + - ninja check-cxx + +on_failure: + - appveyor PushArtifact CMakeFiles/CMakeOutput.log + - appveyor PushArtifact CMakeFiles/CMakeError.log + +artifacts: + - path: '_build/CMakeFiles/*.log' + name: logs + +cache: + - C:\projects\deps\llvm diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index a4105be08340..8211ebd009a7 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -63,7 +63,7 @@ endif() # Benchmark tests configuration #============================================================================== add_custom_target(cxx-benchmarks) - +set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx) set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native) set(BENCHMARK_TEST_COMPILE_FLAGS @@ -111,6 +111,7 @@ macro(add_benchmark_test name source_file) set_target_properties(${libcxx_target} PROPERTIES OUTPUT_NAME "${name}.libcxx.out" + RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}" COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}" LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}") if (LIBCXX_BENCHMARK_NATIVE_STDLIB) @@ -131,6 +132,7 @@ macro(add_benchmark_test name source_file) set_target_properties(${native_target} PROPERTIES OUTPUT_NAME "${name}.native.out" + RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}" INCLUDE_DIRECTORIES "" COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}" LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}") diff --git a/include/__functional_base b/include/__functional_base index 4e2b7eb8d289..0d2c2fc65015 100644 --- a/include/__functional_base +++ b/include/__functional_base @@ -251,7 +251,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> }; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG // 3 or more arguments template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> @@ -296,10 +296,6 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> typedef _Rp result_type; }; -#endif // _LIBCPP_HAS_NO_VARIADICS - -#ifndef _LIBCPP_CXX03_LANG - template <class _Tp, class ..._Args> struct __invoke_return { @@ -316,7 +312,7 @@ struct __invoke_return template <class _Ret> struct __invoke_void_return_wrapper { -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class ..._Args> static _Ret __call(_Args&&... __args) { return __invoke(_VSTD::forward<_Args>(__args)...); @@ -347,7 +343,7 @@ struct __invoke_void_return_wrapper template <> struct __invoke_void_return_wrapper<void> { -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class ..._Args> static void __call(_Args&&... __args) { __invoke(_VSTD::forward<_Args>(__args)...); @@ -389,7 +385,7 @@ public: // construct/copy/destroy _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT : __f_(_VSTD::addressof(__f)) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG private: reference_wrapper(type&&); public: // = delete; // do not bind to temps #endif @@ -397,7 +393,7 @@ public: _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;} _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;} -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG // invoke template <class... _ArgTypes> _LIBCPP_INLINE_VISIBILITY @@ -510,7 +506,7 @@ public: operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const { return __invoke(get(), __a0, __a1, __a2); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG }; @@ -568,7 +564,7 @@ public: struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { }; -#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY) +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY) extern const allocator_arg_t allocator_arg; #else constexpr allocator_arg_t allocator_arg = allocator_arg_t(); @@ -611,7 +607,7 @@ template <class _Tp, class _Alloc> constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value; #endif -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG // allocator construction @@ -663,7 +659,7 @@ void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __storage, __a, _VSTD::forward<_Args>(__args)... ); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD diff --git a/include/__hash_table b/include/__hash_table index a20cbb8ed08b..acdc443a640a 100644 --- a/include/__hash_table +++ b/include/__hash_table @@ -798,8 +798,7 @@ public: _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value) : __data_(__size, __a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __bucket_list_deallocator(__bucket_list_deallocator&& __x) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value) @@ -807,8 +806,7 @@ public: { __x.size() = 0; } - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif _LIBCPP_INLINE_VISIBILITY size_type& size() _NOEXCEPT {return __data_.first();} diff --git a/include/__mutex_base b/include/__mutex_base index 4940f931c97f..a6d5e79c4c86 100644 --- a/include/__mutex_base +++ b/include/__mutex_base @@ -34,7 +34,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex { -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER; #else __libcpp_mutex_t __m_; @@ -42,7 +42,7 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mut public: _LIBCPP_INLINE_VISIBILITY -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG constexpr mutex() _NOEXCEPT = default; #else mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;} @@ -66,7 +66,7 @@ struct _LIBCPP_TYPE_VIS defer_lock_t {}; struct _LIBCPP_TYPE_VIS try_to_lock_t {}; struct _LIBCPP_TYPE_VIS adopt_lock_t {}; -#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX) +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MUTEX) extern const defer_lock_t defer_lock; extern const try_to_lock_t try_to_lock; @@ -150,7 +150,7 @@ private: unique_lock& operator=(unique_lock const&); // = delete; public: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) @@ -167,7 +167,7 @@ public: return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG void lock(); bool try_lock(); @@ -279,7 +279,7 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status) class _LIBCPP_TYPE_VIS condition_variable { -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER; #else __libcpp_condvar_t __cv_; @@ -287,7 +287,7 @@ class _LIBCPP_TYPE_VIS condition_variable public: _LIBCPP_INLINE_VISIBILITY -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG constexpr condition_variable() _NOEXCEPT = default; #else condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;} diff --git a/include/__split_buffer b/include/__split_buffer index e74cf1f3b772..72073f024cd2 100644 --- a/include/__split_buffer +++ b/include/__split_buffer @@ -66,7 +66,7 @@ public: __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a); ~__split_buffer(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG __split_buffer(__split_buffer&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value); __split_buffer(__split_buffer&& __c, const __alloc_rr& __a); @@ -74,7 +74,7 @@ public: _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value && is_nothrow_move_assignable<allocator_type>::value) || !__alloc_traits::propagate_on_container_move_assignment::value); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;} _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;} @@ -99,14 +99,12 @@ public: void shrink_to_fit() _NOEXCEPT; void push_front(const_reference __x); _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#ifndef _LIBCPP_CXX03_LANG void push_front(value_type&& __x); void push_back(value_type&& __x); -#if !defined(_LIBCPP_HAS_NO_VARIADICS) template <class... _Args> void emplace_back(_Args&&... __args); -#endif // !defined(_LIBCPP_HAS_NO_VARIADICS) -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#endif // !defined(_LIBCPP_CXX03_LANG) _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);} _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);} @@ -343,7 +341,7 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer() __alloc_traits::deallocate(__alloc(), __first_, capacity()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c) @@ -405,7 +403,7 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> void @@ -492,7 +490,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x) --__begin_; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> void @@ -524,7 +522,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x) --__begin_; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -556,7 +554,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x) ++__end_; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> void @@ -588,8 +586,6 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x) ++__end_; } -#ifndef _LIBCPP_HAS_NO_VARIADICS - template <class _Tp, class _Allocator> template <class... _Args> void @@ -621,9 +617,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args) ++__end_; } -#endif // _LIBCPP_HAS_NO_VARIADICS - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY diff --git a/include/__tree b/include/__tree index 2161c6cb79d1..6771589bbc68 100644 --- a/include/__tree +++ b/include/__tree @@ -1105,7 +1105,7 @@ public: void __assign_unique(_InputIterator __first, _InputIterator __last); template <class _InputIterator> void __assign_multi(_InputIterator __first, _InputIterator __last); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG __tree(__tree&& __t) _NOEXCEPT_( is_nothrow_move_constructible<__node_allocator>::value && @@ -1116,7 +1116,7 @@ public: __node_traits::propagate_on_container_move_assignment::value && is_nothrow_move_assignable<value_compare>::value && is_nothrow_move_assignable<__node_allocator>::value); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG ~__tree(); @@ -1675,7 +1675,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t) __begin_node() = __end_node(); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Compare, class _Allocator> __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t) @@ -1805,7 +1805,7 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Compare, class _Allocator> __tree<_Tp, _Compare, _Allocator>::~__tree() diff --git a/include/__tuple b/include/__tuple index 4193d2cfffb7..69d6ee961113 100644 --- a/include/__tuple +++ b/include/__tuple @@ -85,7 +85,7 @@ template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_li // tuple specializations -#if !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template <size_t...> struct __tuple_indices {}; @@ -189,7 +189,8 @@ template <size_t _Ip, class ..._Tp> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, tuple<_Tp...> >::type&& get(const tuple<_Tp...>&&) _NOEXCEPT; -#endif + +#endif // !defined(_LIBCPP_CXX03_LANG) // pair specializations @@ -205,7 +206,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const typename tuple_element<_Ip, pair<_T1, _T2> >::type& get(const pair<_T1, _T2>&) _NOEXCEPT; -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#ifndef _LIBCPP_CXX03_LANG template <size_t _Ip, class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, pair<_T1, _T2> >::type&& @@ -233,7 +234,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Tp& get(const array<_Tp, _Size>&) _NOEXCEPT; -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) +#ifndef _LIBCPP_CXX03_LANG template <size_t _Ip, class _Tp, size_t _Size> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp&& @@ -245,8 +246,7 @@ const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT; #endif -#if !defined(_LIBCPP_HAS_NO_VARIADICS) - +#ifndef _LIBCPP_CXX03_LANG // __tuple_types @@ -468,9 +468,6 @@ template <size_t _Ip, class ..._Tp> using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; #endif -#endif // _LIBCPP_HAS_NO_VARIADICS - -#ifndef _LIBCPP_CXX03_LANG template <bool _IsTuple, class _SizeTrait, size_t _Expected> struct __tuple_like_with_size_imp : false_type {}; @@ -495,7 +492,7 @@ struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail { template <class ...> static constexpr bool __enable_assign() { return false; } }; -#endif +#endif // !defined(_LIBCPP_CXX03_LANG) #if _LIBCPP_STD_VER > 14 diff --git a/include/algorithm b/include/algorithm index 571edd265508..c3517a11bb0d 100644 --- a/include/algorithm +++ b/include/algorithm @@ -2548,7 +2548,7 @@ min(const _Tp& __a, const _Tp& __b) return _VSTD::min(__a, __b, __less<_Tp>()); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _Tp, class _Compare> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 @@ -2566,7 +2566,7 @@ min(initializer_list<_Tp> __t) return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // max_element @@ -2613,7 +2613,7 @@ max(const _Tp& __a, const _Tp& __b) return _VSTD::max(__a, __b, __less<_Tp>()); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _Tp, class _Compare> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 @@ -2631,7 +2631,7 @@ max(initializer_list<_Tp> __t) return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 // clamp @@ -2732,7 +2732,7 @@ minmax(const _Tp& __a, const _Tp& __b) return _VSTD::minmax(__a, __b, __less<_Tp>()); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _Tp, class _Compare> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 @@ -2779,7 +2779,7 @@ minmax(initializer_list<_Tp> __t) return _VSTD::minmax(__t, __less<_Tp>()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // random_shuffle @@ -2837,7 +2837,7 @@ private: _Engine_result_type __mask0_; _Engine_result_type __mask1_; -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1); #else @@ -3080,7 +3080,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last) template <class _RandomAccessIterator, class _RandomNumberGenerator> void random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _RandomNumberGenerator&& __rand) #else _RandomNumberGenerator& __rand) @@ -3173,7 +3173,7 @@ _SampleIterator sample(_PopulationIterator __first, template<class _RandomAccessIterator, class _UniformRandomNumberGenerator> void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _UniformRandomNumberGenerator&& __g) #else _UniformRandomNumberGenerator& __g) diff --git a/include/bitset b/include/bitset index 827a901ffd71..b49c93ce2224 100644 --- a/include/bitset +++ b/include/bitset @@ -197,11 +197,11 @@ protected: _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT; private: -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG void __init(unsigned long long __v, false_type) _NOEXCEPT; _LIBCPP_INLINE_VISIBILITY void __init(unsigned long long __v, true_type) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_CONSTEXPR +#endif // _LIBCPP_CXX03_LANG unsigned long to_ulong(false_type) const; _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong(true_type) const; @@ -217,16 +217,16 @@ template <size_t _N_words, size_t _Size> inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset() _NOEXCEPT -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG : __first_{0} #endif { -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG _VSTD::fill_n(__first_, _N_words, __storage_type(0)); #endif } -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG template <size_t _N_words, size_t _Size> void @@ -249,13 +249,13 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0)); } -#endif // _LIBCPP_HAS_NO_CONSTEXPR +#endif // _LIBCPP_CXX03_LANG template <size_t _N_words, size_t _Size> inline _LIBCPP_CONSTEXPR __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT -#ifndef _LIBCPP_HAS_NO_CONSTEXPR +#ifndef _LIBCPP_CXX03_LANG #if __SIZEOF_SIZE_T__ == 8 : __first_{__v} #elif __SIZEOF_SIZE_T__ == 4 @@ -265,7 +265,7 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT #endif #endif { -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>()); #endif } diff --git a/include/exception b/include/exception index 181d604d6c1e..f12ae42093aa 100644 --- a/include/exception +++ b/include/exception @@ -209,11 +209,11 @@ struct __throw_with_nested; template <class _Tp, class _Up> struct __throw_with_nested<_Tp, _Up, true> { _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void - #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG __do_throw(_Tp&& __t) - #else +#else __do_throw (_Tp& __t) - #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG { throw __nested<_Up>(_VSTD::forward<_Tp>(__t)); } @@ -222,11 +222,11 @@ struct __throw_with_nested<_Tp, _Up, true> { template <class _Tp, class _Up> struct __throw_with_nested<_Tp, _Up, false> { _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void - #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG __do_throw(_Tp&& __t) - #else +#else __do_throw (_Tp& __t) - #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG { throw _VSTD::forward<_Tp>(__t); } @@ -236,11 +236,11 @@ struct __throw_with_nested<_Tp, _Up, false> { template <class _Tp> _LIBCPP_NORETURN void -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG throw_with_nested(_Tp&& __t) #else throw_with_nested (_Tp& __t) -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG { #ifndef _LIBCPP_NO_EXCEPTIONS typedef typename decay<_Tp>::type _Up; diff --git a/include/ext/hash_map b/include/ext/hash_map index fab36a155bac..66f2b11c0594 100644 --- a/include/ext/hash_map +++ b/include/ext/hash_map @@ -331,7 +331,7 @@ public: __second_constructed(false) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x) : __na_(__x.__na_), @@ -340,7 +340,7 @@ public: { __x.__value_constructed = false; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x) : __na_(__x.__na_), @@ -349,7 +349,7 @@ public: { const_cast<bool&>(__x.__value_constructed) = false; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void operator()(pointer __p) diff --git a/include/fstream b/include/fstream index 7bcc5d450daf..5ec42bd13407 100644 --- a/include/fstream +++ b/include/fstream @@ -193,13 +193,13 @@ public: // 27.9.1.2 Constructors/destructor: basic_filebuf(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG basic_filebuf(basic_filebuf&& __rhs); #endif virtual ~basic_filebuf(); // 27.9.1.3 Assign/swap: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_filebuf& operator=(basic_filebuf&& __rhs); #endif @@ -276,7 +276,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf() setbuf(0, 4096); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs) @@ -352,7 +352,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_filebuf<_CharT, _Traits>::~basic_filebuf() @@ -1017,12 +1017,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_ifstream(basic_ifstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_ifstream& operator=(basic_ifstream&& __rhs); #endif @@ -1071,7 +1069,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1092,7 +1090,7 @@ basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1177,12 +1175,10 @@ public: explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out); _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_ofstream(basic_ofstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_ofstream& operator=(basic_ofstream&& __rhs); #endif @@ -1231,7 +1227,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1252,7 +1248,7 @@ basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1339,12 +1335,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_fstream(basic_fstream&& __rhs); -#endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY basic_fstream& operator=(basic_fstream&& __rhs); #endif @@ -1393,7 +1387,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm } #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline @@ -1414,7 +1408,7 @@ basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> inline diff --git a/include/functional b/include/functional index 15e672e0efc7..386fe678bff3 100644 --- a/include/functional +++ b/include/functional @@ -1264,7 +1264,7 @@ private: public: _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {} -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG // invoke template <class... _ArgTypes> _LIBCPP_INLINE_VISIBILITY @@ -1454,7 +1454,7 @@ bool __not_null(function<_Fp> const& __f) { return !!__f; } } // namespace __function -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG namespace __function { @@ -1983,7 +1983,7 @@ void swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT {return __x.swap(__y);} -#else // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_CXX03_LANG #include <__functional_03> @@ -2047,7 +2047,7 @@ struct __is_placeholder<placeholders::__ph<_Np> > : public integral_constant<int, _Np> {}; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Uj> inline _LIBCPP_INLINE_VISIBILITY @@ -2347,7 +2347,7 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args) return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 diff --git a/include/initializer_list b/include/initializer_list index d6dfa80817a5..8c234aaaab2a 100644 --- a/include/initializer_list +++ b/include/initializer_list @@ -53,7 +53,7 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in namespace std // purposefully not versioned { -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _Ep> class _LIBCPP_TEMPLATE_VIS initializer_list @@ -111,7 +111,7 @@ end(initializer_list<_Ep> __il) _NOEXCEPT return __il.end(); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // !defined(_LIBCPP_CXX03_LANG) } // std diff --git a/include/ios b/include/ios index 49f0c01f9858..61d00b90ee04 100644 --- a/include/ios +++ b/include/ios @@ -657,7 +657,7 @@ protected: _LIBCPP_INLINE_VISIBILITY void move(basic_ios& __rhs); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_ALWAYS_INLINE void move(basic_ios&& __rhs) {move(__rhs);} #endif diff --git a/include/istream b/include/istream index 774f38df2e3c..9a8bb44ef3ec 100644 --- a/include/istream +++ b/include/istream @@ -189,12 +189,11 @@ public: { this->init(__sb); } virtual ~basic_istream(); protected: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_istream(basic_istream&& __rhs); -#endif + // 27.7.1.1.2 Assign/swap: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES inline _LIBCPP_INLINE_VISIBILITY basic_istream& operator=(basic_istream&& __rhs); #endif @@ -332,7 +331,7 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _ __is.setstate(ios_base::failbit); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs) @@ -350,7 +349,7 @@ basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_istream<_CharT, _Traits>::~basic_istream() @@ -1424,7 +1423,7 @@ ws(basic_istream<_CharT, _Traits>& __is) return __is; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Tp> inline _LIBCPP_INLINE_VISIBILITY @@ -1435,7 +1434,7 @@ operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x) return __is; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> class _LIBCPP_TEMPLATE_VIS basic_iostream @@ -1458,13 +1457,11 @@ public: virtual ~basic_iostream(); protected: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_iostream(basic_iostream&& __rhs); -#endif // assign/swap -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES inline _LIBCPP_INLINE_VISIBILITY basic_iostream& operator=(basic_iostream&& __rhs); #endif @@ -1474,7 +1471,7 @@ protected: public: }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs) @@ -1490,7 +1487,7 @@ basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_iostream<_CharT, _Traits>::~basic_iostream() @@ -1607,7 +1604,7 @@ getline(basic_istream<_CharT, _Traits>& __is, return getline(__is, __str, __is.widen('\n')); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template<class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -1627,7 +1624,7 @@ getline(basic_istream<_CharT, _Traits>&& __is, return getline(__is, __str, __is.widen('\n')); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, size_t _Size> basic_istream<_CharT, _Traits>& diff --git a/include/iterator b/include/iterator index 66d1a310d22f..47a7811a3004 100644 --- a/include/iterator +++ b/include/iterator @@ -783,10 +783,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {} _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_) {container->push_back(__value_); return *this;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_) {container->push_back(_VSTD::move(__value_)); return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;} _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;} _LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;} @@ -816,10 +816,10 @@ public: _LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {} _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_) {container->push_front(__value_); return *this;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_) {container->push_front(_VSTD::move(__value_)); return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;} _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;} _LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;} @@ -851,10 +851,10 @@ public: : container(_VSTD::addressof(__x)), iter(__i) {} _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_) {iter = container->insert(iter, __value_); ++iter; return *this;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_) {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;} _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;} _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;} @@ -1060,7 +1060,7 @@ public: typedef typename iterator_traits<iterator_type>::value_type value_type; typedef typename iterator_traits<iterator_type>::difference_type difference_type; typedef iterator_type pointer; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG typedef typename iterator_traits<iterator_type>::reference __reference; typedef typename conditional< is_reference<__reference>::value, diff --git a/include/locale b/include/locale index da31a1e62cb2..6bce16e64884 100644 --- a/include/locale +++ b/include/locale @@ -3570,7 +3570,7 @@ public: wstring_convert(_Codecvt* __pcvt, state_type __state); _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err, const wide_string& __wide_err = wide_string()); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_ALWAYS_INLINE wstring_convert(wstring_convert&& __wc); #endif @@ -3629,7 +3629,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>:: __cvtptr_ = new _Codecvt; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> inline @@ -3643,7 +3643,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>:: __wc.__cvtptr_ = nullptr; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert() diff --git a/include/map b/include/map index c8131eceb72b..71f18693f6d1 100644 --- a/include/map +++ b/include/map @@ -582,7 +582,7 @@ public: __second_constructed(false) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT : __na_(__x.__na_), @@ -591,7 +591,7 @@ public: { __x.__value_constructed = false; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void operator()(pointer __p) _NOEXCEPT @@ -667,7 +667,7 @@ private: ~__value_type(); }; -#endif +#endif // _LIBCPP_CXX03_LANG template <class _Tp> struct __extract_key_value_types; @@ -921,7 +921,7 @@ public: return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY map(map&& __m) @@ -940,10 +940,6 @@ public: return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY map(initializer_list<value_type> __il, const key_compare& __comp = key_compare()) : __tree_(__vc(__comp)) @@ -971,7 +967,7 @@ public: return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit map(const allocator_type& __a) @@ -1082,6 +1078,10 @@ public: _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, value_type&& __v) {return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));} + + _LIBCPP_INLINE_VISIBILITY + void insert(initializer_list<value_type> __il) + {insert(__il.begin(), __il.end());} #endif template <class _InputIterator> @@ -1092,14 +1092,6 @@ public: insert(__e.__i_, *__f); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - - _LIBCPP_INLINE_VISIBILITY - void insert(initializer_list<value_type> __il) - {insert(__il.begin(), __il.end());} - -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - #if _LIBCPP_STD_VER > 14 template <class... _Args> @@ -1194,7 +1186,7 @@ public: return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v)); } -#endif +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);} @@ -1307,7 +1299,6 @@ private: #ifndef _LIBCPP_CXX03_LANG - template <class _Key, class _Tp, class _Compare, class _Allocator> map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a) : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a)) @@ -1321,10 +1312,27 @@ map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a) } } -#endif // !_LIBCPP_CXX03_LANG +template <class _Key, class _Tp, class _Compare, class _Allocator> +_Tp& +map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) +{ + return __tree_.__emplace_unique_key_args(__k, + _VSTD::piecewise_construct, + _VSTD::forward_as_tuple(__k), + _VSTD::forward_as_tuple()).first->__cc.second; +} +template <class _Key, class _Tp, class _Compare, class _Allocator> +_Tp& +map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) +{ + return __tree_.__emplace_unique_key_args(__k, + _VSTD::piecewise_construct, + _VSTD::forward_as_tuple(_VSTD::move(__k)), + _VSTD::forward_as_tuple()).first->__cc.second; +} -#ifdef _LIBCPP_CXX03_LANG +#else // _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Compare, class _Allocator> typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder @@ -1355,29 +1363,7 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) return __r->__value_.__cc.second; } -#else - -template <class _Key, class _Tp, class _Compare, class _Allocator> -_Tp& -map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k) -{ - return __tree_.__emplace_unique_key_args(__k, - _VSTD::piecewise_construct, - _VSTD::forward_as_tuple(__k), - _VSTD::forward_as_tuple()).first->__cc.second; -} - -template <class _Key, class _Tp, class _Compare, class _Allocator> -_Tp& -map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k) -{ - return __tree_.__emplace_unique_key_args(__k, - _VSTD::piecewise_construct, - _VSTD::forward_as_tuple(_VSTD::move(__k)), - _VSTD::forward_as_tuple()).first->__cc.second; -} - -#endif // !_LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Compare, class _Allocator> _Tp& @@ -1593,7 +1579,7 @@ public: return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY multimap(multimap&& __m) @@ -1612,10 +1598,6 @@ public: return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare()) : __tree_(__vc(__comp)) @@ -1643,7 +1625,7 @@ public: return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit multimap(const allocator_type& __a) @@ -1736,6 +1718,11 @@ public: iterator insert(const_iterator __p, value_type&& __v) {return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));} + + _LIBCPP_INLINE_VISIBILITY + void insert(initializer_list<value_type> __il) + {insert(__il.begin(), __il.end());} + #endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY @@ -1753,14 +1740,6 @@ public: __tree_.__insert_multi(__e.__i_, *__f); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - - _LIBCPP_INLINE_VISIBILITY - void insert(initializer_list<value_type> __il) - {insert(__il.begin(), __il.end());} - -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);} _LIBCPP_INLINE_VISIBILITY diff --git a/include/memory b/include/memory index 44a0c34e43e1..3fc0e5a1bf12 100644 --- a/include/memory +++ b/include/memory @@ -2079,17 +2079,12 @@ struct __compressed_pair_elem { typedef const _Tp& const_reference; #ifndef _LIBCPP_CXX03_LANG - template <bool _Dummy = true, class = typename enable_if< - __dependent_type<is_default_constructible<_Tp>, _Dummy>::value - >::type - > - _LIBCPP_CONSTEXPR __compressed_pair_elem() - _NOEXCEPT_(is_nothrow_default_constructible<_Tp>::value) - : __value_() {} + constexpr __compressed_pair_elem() : __value_() {} template <class _Up, class = typename enable_if< - !is_same<__compressed_pair_elem, _Up>::value>::type> - _LIBCPP_CONSTEXPR explicit + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_(_VSTD::forward<_Up>(__u)){}; @@ -2118,11 +2113,12 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp { typedef _Tp __value_type; #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_CONSTEXPR __compressed_pair_elem() = default; + constexpr __compressed_pair_elem() = default; template <class _Up, class = typename enable_if< - !is_same<__compressed_pair_elem, _Up>::value>::type> - _LIBCPP_CONSTEXPR explicit + !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value + >::type> + constexpr explicit __compressed_pair_elem(_Up&& __u) : __value_type(_VSTD::forward<_Up>(__u)){}; @@ -2161,8 +2157,14 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>, public: #ifndef _LIBCPP_CXX03_LANG + template <bool _Dummy = true, + class = typename enable_if< + __dependent_type<is_default_constructible<_T1>, _Dummy>::value && + __dependent_type<is_default_constructible<_T2>, _Dummy>::value + >::type + > _LIBCPP_INLINE_VISIBILITY - __compressed_pair() = default; + constexpr __compressed_pair() {} template <class _Tp, typename enable_if<!is_same<typename decay<_Tp>::type, __compressed_pair>::value, @@ -2734,7 +2736,7 @@ public: > _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept - : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) { + : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) { } template <class _Up, class _Ep, diff --git a/include/mutex b/include/mutex index f28d37c83e63..e92baa51ae75 100644 --- a/include/mutex +++ b/include/mutex @@ -191,7 +191,7 @@ template<class Callable, class ...Args> #include <__mutex_base> #include <functional> #include <memory> -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG #include <tuple> #endif #include <__threading_support> @@ -343,7 +343,7 @@ try_lock(_L0& __l0, _L1& __l1) return 0; } -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _L0, class _L1, class _L2, class... _L3> int @@ -362,7 +362,7 @@ try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) return __r; } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG template <class _L0, class _L1> void @@ -391,7 +391,7 @@ lock(_L0& __l0, _L1& __l1) } } -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _L0, class _L1, class _L2, class ..._L3> void @@ -466,7 +466,7 @@ void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) { _VSTD::__unlock(__l2, __l3...); } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 template <class ..._Mutexes> @@ -550,13 +550,13 @@ private: struct _LIBCPP_TEMPLATE_VIS once_flag; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template<class _Callable, class... _Args> _LIBCPP_INLINE_VISIBILITY void call_once(once_flag&, _Callable&&, _Args&&...); -#else // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_CXX03_LANG template<class _Callable> _LIBCPP_INLINE_VISIBILITY @@ -566,7 +566,7 @@ template<class _Callable> _LIBCPP_INLINE_VISIBILITY void call_once(once_flag&, const _Callable&); -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG struct _LIBCPP_TEMPLATE_VIS once_flag { @@ -580,11 +580,11 @@ private: unsigned long __state_; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template<class _Callable, class... _Args> friend void call_once(once_flag&, _Callable&&, _Args&&...); -#else // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_CXX03_LANG template<class _Callable> friend void call_once(once_flag&, _Callable&); @@ -592,10 +592,10 @@ private: template<class _Callable> friend void call_once(once_flag&, const _Callable&); -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG }; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _Fp> class __call_once_param @@ -650,7 +650,7 @@ __call_once_proxy(void* __vp) _LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*)); -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template<class _Callable, class... _Args> inline _LIBCPP_INLINE_VISIBILITY @@ -666,7 +666,7 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) } } -#else // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_CXX03_LANG template<class _Callable> inline _LIBCPP_INLINE_VISIBILITY @@ -692,7 +692,7 @@ call_once(once_flag& __flag, const _Callable& __func) } } -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD diff --git a/include/optional b/include/optional index 118d71782882..8c7a242113a0 100644 --- a/include/optional +++ b/include/optional @@ -17,29 +17,31 @@ // C++1z namespace std { - // 20.6.3, optional for object types + // 23.6.3, optional for object types template <class T> class optional; - // 20.6.4, no-value state indicator + // 23.6.4, no-value state indicator struct nullopt_t{see below }; constexpr nullopt_t nullopt(unspecified ); - // 20.6.5, class bad_optional_access + // 23.6.5, class bad_optional_access class bad_optional_access; - // 20.6.6, relational operators - template <class T> - constexpr bool operator==(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator!=(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator<(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator>(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator<=(const optional<T>&, const optional<T>&); - template <class T> - constexpr bool operator>=(const optional<T>&, const optional<T>&); + // 23.6.6, relational operators + template <class T, class U> + constexpr bool operator==(const optional<T>&, const optional<U>&); + template <class T, class U> + constexpr bool operator!=(const optional<T>&, const optional<U>&); + template <class T, class U> + constexpr bool operator<(const optional<T>&, const optional<U>&); + template <class T, class U> + constexpr bool operator>(const optional<T>&, const optional<U>&); + template <class T, class U> + constexpr bool operator<=(const optional<T>&, const optional<U>&); + template <class T, class U> + constexpr bool operator>=(const optional<T>&, const optional<U>&); + + // 23.6.7 comparison with nullopt template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept; template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept; template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept; @@ -53,21 +55,21 @@ namespace std { template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept; template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept; - // 20.6.8, comparison with T - template <class T> constexpr bool operator==(const optional<T>&, const T&); - template <class T> constexpr bool operator==(const T&, const optional<T>&); - template <class T> constexpr bool operator!=(const optional<T>&, const T&); - template <class T> constexpr bool operator!=(const T&, const optional<T>&); - template <class T> constexpr bool operator<(const optional<T>&, const T&); - template <class T> constexpr bool operator<(const T&, const optional<T>&); - template <class T> constexpr bool operator<=(const optional<T>&, const T&); - template <class T> constexpr bool operator<=(const T&, const optional<T>&); - template <class T> constexpr bool operator>(const optional<T>&, const T&); - template <class T> constexpr bool operator>(const T&, const optional<T>&); - template <class T> constexpr bool operator>=(const optional<T>&, const T&); - template <class T> constexpr bool operator>=(const T&, const optional<T>&); - - // 20.6.9, specialized algorithms + // 23.6.8, comparison with T + template <class T, class U> constexpr bool operator==(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator==(const U&, const optional<T>&); + template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator!=(const U&, const optional<T>&); + template <class T, class U> constexpr bool operator<(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator<(const U&, const optional<T>&); + template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator<=(const U&, const optional<T>&); + template <class T, class U> constexpr bool operator>(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator>(const U&, const optional<T>&); + template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&); + template <class T, class U> constexpr bool operator>=(const U&, const optional<T>&); + + // 23.6.9, specialized algorithms template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below ); template <class T> constexpr optional<see below > make_optional(T&&); template <class T, class... Args> @@ -75,7 +77,7 @@ namespace std { template <class T, class U, class... Args> constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args); - // 20.6.10, hash support + // 23.6.10, hash support template <class T> struct hash; template <class T> struct hash<optional<T>>; @@ -83,7 +85,7 @@ namespace std { public: using value_type = T; - // 20.6.3.1, constructors + // 23.6.3.1, constructors constexpr optional() noexcept; constexpr optional(nullopt_t) noexcept; optional(const optional &); @@ -98,10 +100,10 @@ namespace std { template <class U> constexpr EXPLICIT optional(optional<U> &&); - // 20.6.3.2, destructor + // 23.6.3.2, destructor ~optional(); - // 20.6.3.3, assignment + // 23.6.3.3, assignment optional &operator=(nullopt_t) noexcept; optional &operator=(const optional &); optional &operator=(optional &&) noexcept(see below ); @@ -112,10 +114,10 @@ namespace std { template <class U, class... Args> T& emplace(initializer_list<U>, Args &&...); - // 20.6.3.4, swap + // 23.6.3.4, swap void swap(optional &) noexcept(see below ); - // 20.6.3.5, observers + // 23.6.3.5, observers constexpr T const *operator->() const; constexpr T *operator->(); constexpr T const &operator*() const &; @@ -131,7 +133,7 @@ namespace std { template <class U> constexpr T value_or(U &&) const &; template <class U> constexpr T value_or(U &&) &&; - // 20.6.3.6, modifiers + // 23.6.3.6, modifiers void reset() noexcept; private: diff --git a/include/ostream b/include/ostream index 3d9be8b7aa56..ca2c83f74a3f 100644 --- a/include/ostream +++ b/include/ostream @@ -165,13 +165,11 @@ public: { this->init(__sb); } virtual ~basic_ostream(); protected: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_ostream(basic_ostream&& __rhs); -#endif // 27.7.2.3 Assign/swap -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES inline _LIBCPP_INLINE_VISIBILITY basic_ostream& operator=(basic_ostream&& __rhs); #endif @@ -290,7 +288,7 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry() } } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs) @@ -306,7 +304,7 @@ basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits> basic_ostream<_CharT, _Traits>::~basic_ostream() @@ -1023,7 +1021,7 @@ flush(basic_ostream<_CharT, _Traits>& __os) return __os; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Stream, class _Tp> inline _LIBCPP_INLINE_VISIBILITY @@ -1039,7 +1037,7 @@ operator<<(_Stream&& __os, const _Tp& __x) return _VSTD::move(__os); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template<class _CharT, class _Traits, class _Allocator> basic_ostream<_CharT, _Traits>& diff --git a/include/queue b/include/queue index 57d420c7406c..feaae8920463 100644 --- a/include/queue +++ b/include/queue @@ -213,29 +213,27 @@ public: _LIBCPP_INLINE_VISIBILITY queue(const queue& __q) : c(__q.c) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY + queue& operator=(const queue& __q) {c = __q.c; return *this;} + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY queue(queue&& __q) _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value) : c(_VSTD::move(__q.c)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - queue& operator=(const queue& __q) {c = __q.c; return *this;} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY queue& operator=(queue&& __q) _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) {c = _VSTD::move(__q.c); return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit queue(const container_type& __c) : c(__c) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Alloc> _LIBCPP_INLINE_VISIBILITY explicit queue(const _Alloc& __a, @@ -254,7 +252,7 @@ public: typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0) : c(__c, __a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Alloc> _LIBCPP_INLINE_VISIBILITY queue(container_type&& __c, const _Alloc& __a, @@ -268,7 +266,7 @@ public: _Alloc>::value>::type* = 0) : c(_VSTD::move(__q.c), __a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} @@ -286,10 +284,9 @@ public: _LIBCPP_INLINE_VISIBILITY void push(const value_type& __v) {c.push_back(__v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} -#ifndef _LIBCPP_HAS_NO_VARIADICS template <class... _Args> _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 @@ -299,8 +296,7 @@ public: void emplace(_Args&&... __args) { c.emplace_back(_VSTD::forward<_Args>(__args)...);} #endif -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void pop() {c.pop_front();} @@ -418,32 +414,30 @@ public: _LIBCPP_INLINE_VISIBILITY priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY + priority_queue& operator=(const priority_queue& __q) + {c = __q.c; comp = __q.comp; return *this;} + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY priority_queue(priority_queue&& __q) _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value && is_nothrow_move_constructible<value_compare>::value) : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - - _LIBCPP_INLINE_VISIBILITY - priority_queue& operator=(const priority_queue& __q) - {c = __q.c; comp = __q.comp; return *this;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY priority_queue& operator=(priority_queue&& __q) _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value && is_nothrow_move_assignable<value_compare>::value) {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const value_compare& __comp) : c(), comp(__comp) {} _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const container_type& __c); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const value_compare& __comp, container_type&& __c); #endif @@ -455,12 +449,12 @@ public: _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _InputIter> _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Alloc> _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const _Alloc& __a, @@ -482,7 +476,7 @@ public: priority_queue(const priority_queue& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Alloc> _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, container_type&& __c, @@ -494,7 +488,7 @@ public: priority_queue(priority_queue&& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} @@ -505,13 +499,13 @@ public: _LIBCPP_INLINE_VISIBILITY void push(const value_type& __v); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void push(value_type&& __v); -#ifndef _LIBCPP_HAS_NO_VARIADICS - template <class... _Args> _LIBCPP_INLINE_VISIBILITY void emplace(_Args&&... __args); -#endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + template <class... _Args> + _LIBCPP_INLINE_VISIBILITY + void emplace(_Args&&... __args); +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void pop(); @@ -531,7 +525,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp _VSTD::make_heap(c.begin(), c.end(), comp); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> inline @@ -543,7 +537,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> template <class _InputIter> @@ -569,7 +563,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input _VSTD::make_heap(c.begin(), c.end(), comp); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> template <class _InputIter> @@ -584,7 +578,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> template <class _Alloc> @@ -635,7 +629,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& _VSTD::make_heap(c.begin(), c.end(), comp); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> template <class _Alloc> @@ -664,7 +658,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q, _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> inline @@ -675,7 +669,7 @@ priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v) _VSTD::push_heap(c.begin(), c.end(), comp); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> inline @@ -686,8 +680,6 @@ priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v) _VSTD::push_heap(c.begin(), c.end(), comp); } -#ifndef _LIBCPP_HAS_NO_VARIADICS - template <class _Tp, class _Container, class _Compare> template <class... _Args> inline @@ -698,8 +690,7 @@ priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args) _VSTD::push_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp, class _Container, class _Compare> inline diff --git a/include/random b/include/random index 835ebdb6c136..83fff90a4178 100644 --- a/include/random +++ b/include/random @@ -2826,7 +2826,7 @@ public: static _LIBCPP_CONSTEXPR const size_t block_size = __p; static _LIBCPP_CONSTEXPR const size_t used_block = __r; -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG static const result_type _Min = _Engine::_Min; static const result_type _Max = _Engine::_Max; #else @@ -2845,11 +2845,11 @@ public: _LIBCPP_INLINE_VISIBILITY explicit discard_block_engine(const _Engine& __e) : __e_(__e), __n_(0) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit discard_block_engine(_Engine&& __e) : __e_(_VSTD::move(__e)), __n_(0) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {} template<class _Sseq> @@ -3014,7 +3014,7 @@ private: result_type, _Engine_result_type >::type _Working_result_type; -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min + _Working_result_type(1); #else @@ -3055,11 +3055,11 @@ public: _LIBCPP_INLINE_VISIBILITY explicit independent_bits_engine(const _Engine& __e) : __e_(__e) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit independent_bits_engine(_Engine&& __e) : __e_(_VSTD::move(__e)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit independent_bits_engine(result_type __sd) : __e_(__sd) {} template<class _Sseq> @@ -3264,7 +3264,7 @@ public: // engine characteristics static _LIBCPP_CONSTEXPR const size_t table_size = __k; -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG static const result_type _Min = _Engine::_Min; static const result_type _Max = _Engine::_Max; #else @@ -3285,11 +3285,11 @@ public: _LIBCPP_INLINE_VISIBILITY explicit shuffle_order_engine(const _Engine& __e) : __e_(__e) {__init();} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit shuffle_order_engine(_Engine&& __e) : __e_(_VSTD::move(__e)) {__init();} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();} template<class _Sseq> @@ -3526,11 +3526,11 @@ public: // constructors _LIBCPP_INLINE_VISIBILITY seed_seq() _NOEXCEPT {} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _Tp> _LIBCPP_INLINE_VISIBILITY seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _InputIterator> _LIBCPP_INLINE_VISIBILITY @@ -3637,7 +3637,7 @@ generate_canonical(_URNG& __g) { const size_t _Dt = numeric_limits<_RealType>::digits; const size_t __b = _Dt < __bits ? _Dt : __bits; -#ifdef _LIBCPP_HAS_NO_CONSTEXPR +#ifdef _LIBCPP_CXX03_LANG const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value; #else const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value; @@ -5851,11 +5851,11 @@ public: _LIBCPP_INLINE_VISIBILITY param_type(_InputIterator __f, _InputIterator __l) : __p_(__f, __l) {__init();} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY param_type(initializer_list<double> __wl) : __p_(__wl.begin(), __wl.end()) {__init();} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw); @@ -5898,11 +5898,11 @@ public: _LIBCPP_INLINE_VISIBILITY discrete_distribution(_InputIterator __f, _InputIterator __l) : __p_(__f, __l) {} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY discrete_distribution(initializer_list<double> __wl) : __p_(__wl) {} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> _LIBCPP_INLINE_VISIBILITY discrete_distribution(size_t __nw, double __xmin, double __xmax, @@ -6079,10 +6079,10 @@ public: template<class _InputIteratorB, class _InputIteratorW> param_type(_InputIteratorB __fB, _InputIteratorB __lB, _InputIteratorW __fW); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _UnaryOperation> param_type(initializer_list<result_type> __bl, _UnaryOperation __fw); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); @@ -6132,13 +6132,13 @@ public: _InputIteratorW __fW) : __p_(__fB, __lB, __fW) {} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _UnaryOperation> _LIBCPP_INLINE_VISIBILITY piecewise_constant_distribution(initializer_list<result_type> __bl, _UnaryOperation __fw) : __p_(__bl, __fw) {} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> _LIBCPP_INLINE_VISIBILITY @@ -6268,7 +6268,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type( } } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _RealType> template<class _UnaryOperation> @@ -6293,7 +6293,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type( } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _RealType> template<class _UnaryOperation> @@ -6402,10 +6402,10 @@ public: template<class _InputIteratorB, class _InputIteratorW> param_type(_InputIteratorB __fB, _InputIteratorB __lB, _InputIteratorW __fW); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _UnaryOperation> param_type(initializer_list<result_type> __bl, _UnaryOperation __fw); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); @@ -6455,13 +6455,13 @@ public: _InputIteratorW __fW) : __p_(__fB, __lB, __fW) {} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _UnaryOperation> _LIBCPP_INLINE_VISIBILITY piecewise_linear_distribution(initializer_list<result_type> __bl, _UnaryOperation __fw) : __p_(__bl, __fw) {} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _UnaryOperation> _LIBCPP_INLINE_VISIBILITY @@ -6595,7 +6595,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type( } } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template<class _RealType> template<class _UnaryOperation> @@ -6620,7 +6620,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type( } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template<class _RealType> template<class _UnaryOperation> diff --git a/include/regex b/include/regex index fe97a63763c9..0f49b95a6561 100644 --- a/include/regex +++ b/include/regex @@ -2539,14 +2539,14 @@ public: : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), __end_(0) {__parse(__first, __last);} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_regex(initializer_list<value_type> __il, flag_type __f = regex_constants::ECMAScript) : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0), __end_(0) {__parse(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // ~basic_regex() = default; @@ -2555,11 +2555,11 @@ public: _LIBCPP_INLINE_VISIBILITY basic_regex& operator=(const value_type* __p) {return assign(__p);} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_regex& operator=(initializer_list<value_type> __il) {return assign(__il);} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _ST, class _SA> _LIBCPP_INLINE_VISIBILITY basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p) @@ -2569,7 +2569,7 @@ public: _LIBCPP_INLINE_VISIBILITY basic_regex& assign(const basic_regex& __that) {return *this = __that;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_regex& assign(basic_regex&& __that) _NOEXCEPT {return *this = _VSTD::move(__that);} @@ -2626,14 +2626,14 @@ public: return assign(basic_regex(__first, __last, __f)); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_regex& assign(initializer_list<value_type> __il, flag_type __f = regex_constants::ECMAScript) {return assign(__il.begin(), __il.end(), __f);} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // const operations: _LIBCPP_INLINE_VISIBILITY @@ -6213,7 +6213,7 @@ public: regex_constants::match_default) = delete; #endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, const regex_type& __re, initializer_list<int> __submatches, @@ -6227,7 +6227,7 @@ public: regex_constants::match_flag_type __m = regex_constants::match_default) = delete; #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <size_t _Np> regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b, @@ -6327,7 +6327,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: __init(__a, __b); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template <class _BidirectionalIterator, class _CharT, class _Traits> regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: @@ -6342,7 +6342,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>:: __init(__a, __b); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _BidirectionalIterator, class _CharT, class _Traits> template <size_t _Np> diff --git a/include/set b/include/set index be5c9528caf8..30f2fa88f256 100644 --- a/include/set +++ b/include/set @@ -486,12 +486,12 @@ public: return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY set(set&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) : __tree_(_VSTD::move(__s.__tree_)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit set(const allocator_type& __a) @@ -504,11 +504,9 @@ public: insert(__s.begin(), __s.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG set(set&& __s, const allocator_type& __a); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY set(initializer_list<value_type> __il, const value_compare& __comp = value_compare()) : __tree_(__comp) @@ -536,9 +534,7 @@ public: __tree_.__assign_unique(__il.begin(), __il.end()); return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY set& operator=(set&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) @@ -546,7 +542,7 @@ public: __tree_ = _VSTD::move(__s.__tree_); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __tree_.begin();} @@ -587,7 +583,7 @@ public: size_type max_size() const _NOEXCEPT {return __tree_.max_size();} // modifiers: -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template <class... _Args> _LIBCPP_INLINE_VISIBILITY pair<iterator, bool> emplace(_Args&&... __args) @@ -596,23 +592,15 @@ public: _LIBCPP_INLINE_VISIBILITY iterator emplace_hint(const_iterator __p, _Args&&... __args) {return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);} -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY pair<iterator,bool> insert(const value_type& __v) {return __tree_.__insert_unique(__v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY - pair<iterator,bool> insert(value_type&& __v) - {return __tree_.__insert_unique(_VSTD::move(__v));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, const value_type& __v) {return __tree_.__insert_unique(__p, __v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __p, value_type&& __v) - {return __tree_.__insert_unique(__p, _VSTD::move(__v));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + template <class _InputIterator> _LIBCPP_INLINE_VISIBILITY void insert(_InputIterator __f, _InputIterator __l) @@ -621,11 +609,19 @@ public: __tree_.__insert_unique(__e, *__f); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + pair<iterator,bool> insert(value_type&& __v) + {return __tree_.__insert_unique(_VSTD::move(__v));} + + _LIBCPP_INLINE_VISIBILITY + iterator insert(const_iterator __p, value_type&& __v) + {return __tree_.__insert_unique(__p, _VSTD::move(__v));} + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list<value_type> __il) {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __tree_.erase(__p);} @@ -727,7 +723,7 @@ public: #endif }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Compare, class _Allocator> set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a) @@ -741,7 +737,7 @@ set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a) } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Key, class _Compare, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -901,12 +897,14 @@ public: return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY multiset(multiset&& __s) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value) : __tree_(_VSTD::move(__s.__tree_)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + + multiset(multiset&& __s, const allocator_type& __a); +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit multiset(const allocator_type& __a) : __tree_(__a) {} @@ -916,11 +914,8 @@ public: { insert(__s.begin(), __s.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - multiset(multiset&& __s, const allocator_type& __a); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare()) : __tree_(__comp) @@ -948,9 +943,7 @@ public: __tree_.__assign_multi(__il.begin(), __il.end()); return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY multiset& operator=(multiset&& __s) _NOEXCEPT_(is_nothrow_move_assignable<__base>::value) @@ -958,7 +951,7 @@ public: __tree_ = _VSTD::move(__s.__tree_); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __tree_.begin();} @@ -999,7 +992,7 @@ public: size_type max_size() const _NOEXCEPT {return __tree_.max_size();} // modifiers: -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template <class... _Args> _LIBCPP_INLINE_VISIBILITY iterator emplace(_Args&&... __args) @@ -1008,23 +1001,15 @@ public: _LIBCPP_INLINE_VISIBILITY iterator emplace_hint(const_iterator __p, _Args&&... __args) {return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);} -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY iterator insert(const value_type& __v) {return __tree_.__insert_multi(__v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY - iterator insert(value_type&& __v) - {return __tree_.__insert_multi(_VSTD::move(__v));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, const value_type& __v) {return __tree_.__insert_multi(__p, __v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __p, value_type&& __v) - {return __tree_.__insert_multi(__p, _VSTD::move(__v));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + template <class _InputIterator> _LIBCPP_INLINE_VISIBILITY void insert(_InputIterator __f, _InputIterator __l) @@ -1033,11 +1018,19 @@ public: __tree_.__insert_multi(__e, *__f); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + iterator insert(value_type&& __v) + {return __tree_.__insert_multi(_VSTD::move(__v));} + + _LIBCPP_INLINE_VISIBILITY + iterator insert(const_iterator __p, value_type&& __v) + {return __tree_.__insert_multi(__p, _VSTD::move(__v));} + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list<value_type> __il) {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __tree_.erase(__p);} @@ -1140,7 +1133,7 @@ public: #endif }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Compare, class _Allocator> multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a) @@ -1154,7 +1147,7 @@ multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_t } } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Key, class _Compare, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY diff --git a/include/sstream b/include/sstream index 40b97854f7f0..411374207b4a 100644 --- a/include/sstream +++ b/include/sstream @@ -212,12 +212,10 @@ public: inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringbuf(const string_type& __s, ios_base::openmode __wch = ios_base::in | ios_base::out); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG basic_stringbuf(basic_stringbuf&& __rhs); -#endif // 27.8.1.2 Assign and swap: -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES basic_stringbuf& operator=(basic_stringbuf&& __rhs); #endif void swap(basic_stringbuf& __rhs); @@ -255,7 +253,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& str(__s); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs) @@ -346,7 +344,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> void @@ -641,13 +639,13 @@ public: inline _LIBCPP_INLINE_VISIBILITY explicit basic_istringstream(const string_type& __s, ios_base::openmode __wch = ios_base::in); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_istringstream(basic_istringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_istringstream& operator=(basic_istringstream&& __rhs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_istringstream& __rhs); @@ -675,7 +673,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri { } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs) @@ -694,7 +692,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream& return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs) @@ -758,13 +756,13 @@ public: inline _LIBCPP_INLINE_VISIBILITY explicit basic_ostringstream(const string_type& __s, ios_base::openmode __wch = ios_base::out); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_ostringstream(basic_ostringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_ostringstream& operator=(basic_ostringstream&& __rhs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_ostringstream& __rhs); @@ -792,7 +790,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri { } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs) @@ -811,7 +809,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream& return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> void @@ -877,13 +875,13 @@ public: inline _LIBCPP_INLINE_VISIBILITY explicit basic_stringstream(const string_type& __s, ios_base::openmode __wch = ios_base::in | ios_base::out); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY basic_stringstream(basic_stringstream&& __rhs); // 27.8.2.2 Assign and swap: basic_stringstream& operator=(basic_stringstream&& __rhs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(basic_stringstream& __rhs); @@ -911,7 +909,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string { } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs) @@ -930,7 +928,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&& return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> void diff --git a/include/stack b/include/stack index c797ea5ec6e9..b2d4e2395017 100644 --- a/include/stack +++ b/include/stack @@ -126,29 +126,28 @@ public: _LIBCPP_INLINE_VISIBILITY stack(const stack& __q) : c(__q.c) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY + stack& operator=(const stack& __q) {c = __q.c; return *this;} + + +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY stack(stack&& __q) _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value) : c(_VSTD::move(__q.c)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - stack& operator=(const stack& __q) {c = __q.c; return *this;} - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY stack& operator=(stack&& __q) _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) {c = _VSTD::move(__q.c); return *this;} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - explicit stack(const container_type& __c) : c(__c) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_INLINE_VISIBILITY explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG + + _LIBCPP_INLINE_VISIBILITY + explicit stack(const container_type& __c) : c(__c) {} + template <class _Alloc> _LIBCPP_INLINE_VISIBILITY explicit stack(const _Alloc& __a, @@ -167,7 +166,7 @@ public: typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0) : c(__s.c, __a) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Alloc> _LIBCPP_INLINE_VISIBILITY stack(container_type&& __c, const _Alloc& __a, @@ -180,7 +179,7 @@ public: typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0) : c(_VSTD::move(__s.c), __a) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} @@ -193,10 +192,10 @@ public: _LIBCPP_INLINE_VISIBILITY void push(const value_type& __v) {c.push_back(__v);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} -#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class... _Args> _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 @@ -206,8 +205,8 @@ public: void emplace(_Args&&... __args) { c.emplace_back(_VSTD::forward<_Args>(__args)...);} #endif -#endif // _LIBCPP_HAS_NO_VARIADICS -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY void pop() {c.pop_back();} diff --git a/include/string b/include/string index 1bc91ed12492..af028a023c29 100644 --- a/include/string +++ b/include/string @@ -763,7 +763,7 @@ public: basic_string(const basic_string& __str); basic_string(const basic_string& __str, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string(basic_string&& __str) #if _LIBCPP_STD_VER <= 14 @@ -774,7 +774,7 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string(basic_string&& __str, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s); _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, const _Allocator& __a); @@ -806,12 +806,12 @@ public: template<class _InputIterator> _LIBCPP_INLINE_VISIBILITY basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string(initializer_list<_CharT> __il); _LIBCPP_INLINE_VISIBILITY basic_string(initializer_list<_CharT> __il, const _Allocator& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG inline ~basic_string(); @@ -825,17 +825,15 @@ public: #endif _LIBCPP_INLINE_VISIBILITY basic_string& operator=(__self_view __sv) {return assign(__sv);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& operator=(basic_string&& __str) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); + _LIBCPP_INLINE_VISIBILITY + basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} #endif _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} basic_string& operator=(value_type __c); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY - basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS #if _LIBCPP_DEBUG_LEVEL >= 2 _LIBCPP_INLINE_VISIBILITY @@ -918,9 +916,9 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv) {return append(__sv);} _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);} _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;} -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& append(const basic_string& __str); @@ -968,10 +966,10 @@ public: return __append_forward_unsafe(__first, __last); } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG void push_back(value_type __c); _LIBCPP_INLINE_VISIBILITY @@ -985,7 +983,7 @@ public: basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); } _LIBCPP_INLINE_VISIBILITY basic_string& assign(const basic_string& __str) { return *this = __str; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& assign(basic_string&& str) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)) @@ -1021,10 +1019,10 @@ public: basic_string& >::type assign(_ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& insert(size_type __pos1, const basic_string& __str); @@ -1063,11 +1061,11 @@ public: iterator >::type insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __pos, initializer_list<value_type> __il) {return insert(__pos, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG basic_string& erase(size_type __pos = 0, size_type __n = npos); _LIBCPP_INLINE_VISIBILITY @@ -1109,11 +1107,11 @@ public: basic_string& >::type replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il) {return replace(__i1, __i2, __il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const; _LIBCPP_INLINE_VISIBILITY @@ -1408,7 +1406,7 @@ private: void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void __move_assign(basic_string& __str, false_type) _NOEXCEPT_(__alloc_traits::is_always_equal::value); @@ -1641,7 +1639,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string( #endif } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -1680,7 +1678,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> void @@ -1874,7 +1872,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, #endif } -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -1900,7 +1898,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string( #endif } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> basic_string<_CharT, _Traits, _Allocator>::~basic_string() @@ -2049,7 +2047,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str) return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -3790,7 +3788,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs) return __r; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template<class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -3850,7 +3848,7 @@ operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs) return _VSTD::move(__lhs); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG // swap @@ -3952,7 +3950,7 @@ basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Allocator>& __str); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template<class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY @@ -3966,7 +3964,7 @@ basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>&& __is, basic_string<_CharT, _Traits, _Allocator>& __str); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_DEBUG_LEVEL >= 2 diff --git a/include/strstream b/include/strstream index 81eef2ab4849..b00b9d830dff 100644 --- a/include/strstream +++ b/include/strstream @@ -151,12 +151,12 @@ public: strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0); strstreambuf(const unsigned char* __gnext, streamsize __n); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY strstreambuf(strstreambuf&& __rhs); _LIBCPP_INLINE_VISIBILITY strstreambuf& operator=(strstreambuf&& __rhs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG virtual ~strstreambuf(); @@ -191,7 +191,7 @@ private: void __init(char* __gnext, streamsize __n, char* __pbeg); }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY strstreambuf::strstreambuf(strstreambuf&& __rhs) @@ -226,7 +226,7 @@ strstreambuf::operator=(strstreambuf&& __rhs) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG class _LIBCPP_TYPE_VIS istrstream : public istream @@ -245,7 +245,7 @@ public: istrstream(char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY istrstream(istrstream&& __rhs) : istream(_VSTD::move(__rhs)), @@ -261,7 +261,7 @@ public: __sb_ = _VSTD::move(__rhs.__sb_); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG virtual ~istrstream(); @@ -294,7 +294,7 @@ public: __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY ostrstream(ostrstream&& __rhs) : ostream(_VSTD::move(__rhs)), @@ -310,7 +310,7 @@ public: __sb_ = _VSTD::move(__rhs.__sb_); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG virtual ~ostrstream(); @@ -354,7 +354,7 @@ public: __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY strstream(strstream&& __rhs) : iostream(_VSTD::move(__rhs)), @@ -370,7 +370,7 @@ public: __sb_ = _VSTD::move(__rhs.__sb_); return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG virtual ~strstream(); diff --git a/include/thread b/include/thread index 874ce3ec196c..360b43d5e555 100644 --- a/include/thread +++ b/include/thread @@ -95,7 +95,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time); #include <system_error> #include <chrono> #include <__mutex_base> -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG #include <tuple> #endif #include <__threading_support> @@ -291,7 +291,7 @@ public: _LIBCPP_INLINE_VISIBILITY thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {} -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _Fp, class ..._Args, class = typename enable_if < @@ -300,19 +300,19 @@ public: > _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp&& __f, _Args&&... __args); -#else // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_CXX03_LANG template <class _Fp> _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS explicit thread(_Fp __f); #endif ~thread(); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = _LIBCPP_NULL_THREAD;} _LIBCPP_INLINE_VISIBILITY thread& operator=(thread&& __t) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);} @@ -329,7 +329,7 @@ public: static unsigned hardware_concurrency() _NOEXCEPT; }; -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices> inline _LIBCPP_INLINE_VISIBILITY @@ -369,7 +369,18 @@ thread::thread(_Fp&& __f, _Args&&... __args) __throw_system_error(__ec, "thread constructor failed"); } -#else // _LIBCPP_HAS_NO_VARIADICS +inline +thread& +thread::operator=(thread&& __t) _NOEXCEPT +{ + if (!__libcpp_thread_isnull(&__t_)) + terminate(); + __t_ = __t.__t_; + __t.__t_ = _LIBCPP_NULL_THREAD; + return *this; +} + +#else // _LIBCPP_CXX03_LANG template <class _Fp> struct __thread_invoke_pair { @@ -404,22 +415,7 @@ thread::thread(_Fp __f) __throw_system_error(__ec, "thread constructor failed"); } -#endif // _LIBCPP_HAS_NO_VARIADICS - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -inline -thread& -thread::operator=(thread&& __t) _NOEXCEPT -{ - if (!__libcpp_thread_isnull(&__t_)) - terminate(); - __t_ = __t.__t_; - __t.__t_ = _LIBCPP_NULL_THREAD; - return *this; -} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG inline _LIBCPP_INLINE_VISIBILITY void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);} diff --git a/include/tuple b/include/tuple index f2a74721921a..b869b861cce0 100644 --- a/include/tuple +++ b/include/tuple @@ -148,7 +148,7 @@ template <class... Types> _LIBCPP_BEGIN_NAMESPACE_STD -#ifndef _LIBCPP_HAS_NO_VARIADICS +#ifndef _LIBCPP_CXX03_LANG // __tuple_leaf @@ -1345,9 +1345,6 @@ template <class ..._Tp, class _Alloc> struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc> : true_type {}; -#endif // _LIBCPP_HAS_NO_VARIADICS - -#ifndef _LIBCPP_CXX03_LANG template <class _T1, class _T2> template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2> inline _LIBCPP_INLINE_VISIBILITY @@ -1358,7 +1355,6 @@ pair<_T1, _T2>::pair(piecewise_construct_t, second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...) { } -#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 14 template <class _Tp> @@ -1404,6 +1400,8 @@ _LIBCPP_NOEXCEPT_RETURN( #endif // _LIBCPP_STD_VER > 14 +#endif // !defined(_LIBCPP_CXX03_LANG) + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_TUPLE diff --git a/include/unordered_map b/include/unordered_map index 4fdac160f928..0546c0e2f9f2 100644 --- a/include/unordered_map +++ b/include/unordered_map @@ -547,7 +547,7 @@ public: __second_constructed(false) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x) _NOEXCEPT @@ -557,7 +557,7 @@ public: { __x.__value_constructed = false; } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x) : __na_(__x.__na_), @@ -566,7 +566,7 @@ public: { const_cast<bool&>(__x.__value_constructed) = false; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void operator()(pointer __p) _NOEXCEPT @@ -819,20 +819,18 @@ public: explicit unordered_map(const allocator_type& __a); unordered_map(const unordered_map& __u); unordered_map(const unordered_map& __u, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_map(unordered_map&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); unordered_map(unordered_map&& __u, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS unordered_map(initializer_list<value_type> __il); unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 11 _LIBCPP_INLINE_VISIBILITY unordered_map(size_type __n, const allocator_type& __a) @@ -875,15 +873,13 @@ public: #endif return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_map& operator=(unordered_map&& __u) _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY unordered_map& operator=(initializer_list<value_type> __il); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -928,13 +924,11 @@ public: _LIBCPP_INLINE_VISIBILITY void insert(_InputIterator __first, _InputIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void insert(initializer_list<value_type> __il) {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY pair<iterator, bool> insert(value_type&& __x) {return __table_.__insert_unique(_VSTD::move(__x));} @@ -1078,7 +1072,7 @@ public: // FIXME: Add debug mode checking for the iterator input return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first; } -#endif +#endif // _LIBCPP_STD_VER > 14 _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);} @@ -1277,7 +1271,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( insert(__u.begin(), __u.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -1314,10 +1308,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( initializer_list<value_type> __il) @@ -1354,10 +1344,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( insert(__il.begin(), __il.end()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& @@ -1368,10 +1354,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& @@ -1382,22 +1364,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=( return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifdef _LIBCPP_CXX03_LANG -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder -unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k) -{ - __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k); - __h.get_deleter().__first_constructed = true; - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second)); - __h.get_deleter().__second_constructed = true; - return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 -} -#endif +#endif // _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _InputIterator> @@ -1410,20 +1377,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, __table_.__insert_unique(*__first); } -#ifdef _LIBCPP_CXX03_LANG -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -_Tp& -unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) -{ - iterator __i = find(__k); - if (__i != end()) - return __i->second; - __node_holder __h = __construct_node_with_key(__k); - pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get()); - __h.release(); - return __r.first->second; -} -#else +#ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> _Tp& @@ -1442,8 +1396,35 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k) std::piecewise_construct, std::forward_as_tuple(std::move(__k)), std::forward_as_tuple()).first->__cc.second; } +#else // _LIBCPP_CXX03_LANG -#endif // !_LIBCPP_CXX03_MODE +template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> +typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder +unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k) +{ + __node_allocator& __na = __table_.__node_alloc(); + __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); + __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k); + __h.get_deleter().__first_constructed = true; + __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second)); + __h.get_deleter().__second_constructed = true; + return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 +} + +template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> +_Tp& +unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) +{ + iterator __i = find(__k); + if (__i != end()) + return __i->second; + __node_holder __h = __construct_node_with_key(__k); + pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get()); + __h.release(); + return __r.first->second; +} + +#endif // _LIBCPP_CXX03_MODE template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> _Tp& @@ -1586,13 +1567,11 @@ public: explicit unordered_multimap(const allocator_type& __a); unordered_multimap(const unordered_multimap& __u); unordered_multimap(const unordered_multimap& __u, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multimap(unordered_multimap&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); unordered_multimap(unordered_multimap&& __u, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS unordered_multimap(initializer_list<value_type> __il); unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), @@ -1600,7 +1579,7 @@ public: unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const key_equal& __eql, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 11 _LIBCPP_INLINE_VISIBILITY unordered_multimap(size_type __n, const allocator_type& __a) @@ -1643,15 +1622,13 @@ public: #endif return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multimap& operator=(unordered_multimap&& __u) _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY unordered_multimap& operator=(initializer_list<value_type> __il); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -1688,13 +1665,10 @@ public: _LIBCPP_INLINE_VISIBILITY void insert(_InputIterator __first, _InputIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void insert(initializer_list<value_type> __il) {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));} @@ -1912,7 +1886,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( insert(__u.begin(), __u.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -1951,10 +1925,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( initializer_list<value_type> __il) @@ -1991,10 +1961,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( insert(__il.begin(), __il.end()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& @@ -2005,10 +1971,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multima return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& @@ -2019,7 +1981,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=( return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG diff --git a/include/unordered_set b/include/unordered_set index fc53c8271109..a14fb0004922 100644 --- a/include/unordered_set +++ b/include/unordered_set @@ -408,13 +408,11 @@ public: explicit unordered_set(const allocator_type& __a); unordered_set(const unordered_set& __u); unordered_set(const unordered_set& __u, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_set(unordered_set&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); unordered_set(unordered_set&& __u, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS unordered_set(initializer_list<value_type> __il); unordered_set(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), @@ -432,7 +430,7 @@ public: const hasher& __hf, const allocator_type& __a) : unordered_set(__il, __n, __hf, key_equal(), __a) {} #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // ~unordered_set() = default; _LIBCPP_INLINE_VISIBILITY unordered_set& operator=(const unordered_set& __u) @@ -440,15 +438,13 @@ public: __table_ = __u.__table_; return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_set& operator=(unordered_set&& __u) _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY unordered_set& operator=(initializer_list<value_type> __il); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -474,7 +470,7 @@ public: _LIBCPP_INLINE_VISIBILITY const_iterator cend() const _NOEXCEPT {return __table_.end();} -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template <class... _Args> _LIBCPP_INLINE_VISIBILITY pair<iterator, bool> emplace(_Args&&... __args) @@ -493,51 +489,47 @@ public: iterator emplace_hint(const_iterator, _Args&&... __args) {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;} #endif -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - _LIBCPP_INLINE_VISIBILITY - pair<iterator, bool> insert(const value_type& __x) - {return __table_.__insert_unique(__x);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY pair<iterator, bool> insert(value_type&& __x) {return __table_.__insert_unique(_VSTD::move(__x));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_DEBUG_LEVEL >= 2 - iterator insert(const_iterator __p, const value_type& __x) + iterator insert(const_iterator __p, value_type&& __x) { _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_set::insert(const_iterator, const value_type&) called with an iterator not" + "unordered_set::insert(const_iterator, value_type&&) called with an iterator not" " referring to this unordered_set"); - return insert(__x).first; + return insert(_VSTD::move(__x)).first; } #else - iterator insert(const_iterator, const value_type& __x) - {return insert(__x).first;} + iterator insert(const_iterator, value_type&& __x) + {return insert(_VSTD::move(__x)).first;} #endif -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY + void insert(initializer_list<value_type> __il) + {insert(__il.begin(), __il.end());} +#endif // _LIBCPP_CXX03_LANG + _LIBCPP_INLINE_VISIBILITY + pair<iterator, bool> insert(const value_type& __x) + {return __table_.__insert_unique(__x);} + _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_DEBUG_LEVEL >= 2 - iterator insert(const_iterator __p, value_type&& __x) + iterator insert(const_iterator __p, const value_type& __x) { _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this, - "unordered_set::insert(const_iterator, value_type&&) called with an iterator not" + "unordered_set::insert(const_iterator, const value_type&) called with an iterator not" " referring to this unordered_set"); - return insert(_VSTD::move(__x)).first; + return insert(__x).first; } #else - iterator insert(const_iterator, value_type&& __x) - {return insert(_VSTD::move(__x)).first;} + iterator insert(const_iterator, const value_type& __x) + {return insert(__x).first;} #endif -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIterator> _LIBCPP_INLINE_VISIBILITY void insert(_InputIterator __first, _InputIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - _LIBCPP_INLINE_VISIBILITY - void insert(initializer_list<value_type> __il) - {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __table_.erase(__p);} @@ -717,7 +709,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( insert(__u.begin(), __u.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Value, class _Hash, class _Pred, class _Alloc> inline @@ -752,10 +744,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Value, class _Hash, class _Pred, class _Alloc> unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( initializer_list<value_type> __il) @@ -792,10 +780,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set( insert(__il.begin(), __il.end()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Value, class _Hash, class _Pred, class _Alloc> inline unordered_set<_Value, _Hash, _Pred, _Alloc>& @@ -806,10 +790,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u) return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Value, class _Hash, class _Pred, class _Alloc> inline unordered_set<_Value, _Hash, _Pred, _Alloc>& @@ -820,7 +800,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=( return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _Value, class _Hash, class _Pred, class _Alloc> template <class _InputIterator> @@ -949,13 +929,11 @@ public: explicit unordered_multiset(const allocator_type& __a); unordered_multiset(const unordered_multiset& __u); unordered_multiset(const unordered_multiset& __u, const allocator_type& __a); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multiset(unordered_multiset&& __u) _NOEXCEPT_(is_nothrow_move_constructible<__table>::value); unordered_multiset(unordered_multiset&& __u, const allocator_type& __a); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS unordered_multiset(initializer_list<value_type> __il); unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), @@ -971,7 +949,7 @@ public: unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a) : unordered_multiset(__il, __n, __hf, key_equal(), __a) {} #endif -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG // ~unordered_multiset() = default; _LIBCPP_INLINE_VISIBILITY unordered_multiset& operator=(const unordered_multiset& __u) @@ -979,14 +957,12 @@ public: __table_ = __u.__table_; return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY unordered_multiset& operator=(unordered_multiset&& __u) _NOEXCEPT_(is_nothrow_move_assignable<__table>::value); -#endif -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS unordered_multiset& operator=(initializer_list<value_type> __il); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT @@ -1012,7 +988,7 @@ public: _LIBCPP_INLINE_VISIBILITY const_iterator cend() const _NOEXCEPT {return __table_.end();} -#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_CXX03_LANG template <class... _Args> _LIBCPP_INLINE_VISIBILITY iterator emplace(_Args&&... __args) @@ -1021,29 +997,27 @@ public: _LIBCPP_INLINE_VISIBILITY iterator emplace_hint(const_iterator __p, _Args&&... __args) {return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);} -#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) - _LIBCPP_INLINE_VISIBILITY - iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));} -#endif - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator __p, const value_type& __x) - {return __table_.__insert_multi(__p, __x);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __p, value_type&& __x) {return __table_.__insert_multi(__p, _VSTD::move(__x));} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _InputIterator> - _LIBCPP_INLINE_VISIBILITY - void insert(_InputIterator __first, _InputIterator __last); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY void insert(initializer_list<value_type> __il) {insert(__il.begin(), __il.end());} -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG + + _LIBCPP_INLINE_VISIBILITY + iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} + + _LIBCPP_INLINE_VISIBILITY + iterator insert(const_iterator __p, const value_type& __x) + {return __table_.__insert_multi(__p, __x);} + + template <class _InputIterator> + _LIBCPP_INLINE_VISIBILITY + void insert(_InputIterator __first, _InputIterator __last); _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __p) {return __table_.erase(__p);} @@ -1224,7 +1198,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( insert(__u.begin(), __u.end()); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Value, class _Hash, class _Pred, class _Alloc> inline @@ -1259,10 +1233,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( #endif } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Value, class _Hash, class _Pred, class _Alloc> unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( initializer_list<value_type> __il) @@ -1299,10 +1269,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset( insert(__il.begin(), __il.end()); } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Value, class _Hash, class _Pred, class _Alloc> inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>& @@ -1314,10 +1280,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=( return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Value, class _Hash, class _Pred, class _Alloc> inline unordered_multiset<_Value, _Hash, _Pred, _Alloc>& @@ -1328,7 +1290,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=( return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _Value, class _Hash, class _Pred, class _Alloc> template <class _InputIterator> diff --git a/include/utility b/include/utility index 1f41c0771128..be73207133b5 100644 --- a/include/utility +++ b/include/utility @@ -272,14 +272,14 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::v template <class _Tp> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG typename conditional < !is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value, const _Tp&, _Tp&& >::type -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG const _Tp& #endif move_if_noexcept(_Tp& __x) _NOEXCEPT @@ -293,7 +293,7 @@ template <class _Tp> void as_const(const _Tp&&) = delete; #endif struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { }; -#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY) +#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY) extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t(); #else constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); @@ -608,8 +608,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) __x.swap(__y); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> struct __make_pair_return_impl @@ -638,7 +637,7 @@ make_pair(_T1&& __t1, _T2&& __t2) (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2)); } -#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#else // _LIBCPP_CXX03_LANG template <class _T1, class _T2> inline _LIBCPP_INLINE_VISIBILITY @@ -648,7 +647,7 @@ make_pair(_T1 __x, _T2 __y) return pair<_T1, _T2>(__x, __y); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _T1, class _T2> class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> > @@ -685,8 +684,7 @@ struct __get_pair<0> const _T1& get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#ifndef _LIBCPP_CXX03_LANG template <class _T1, class _T2> static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 @@ -698,8 +696,7 @@ struct __get_pair<0> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _T1&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG }; template <> @@ -717,8 +714,7 @@ struct __get_pair<1> const _T2& get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#ifndef _LIBCPP_CXX03_LANG template <class _T1, class _T2> static _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 @@ -730,8 +726,7 @@ struct __get_pair<1> _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _T2&& get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);} - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG }; template <size_t _Ip, class _T1, class _T2> @@ -750,8 +745,7 @@ get(const pair<_T1, _T2>& __p) _NOEXCEPT return __get_pair<_Ip>::get(__p); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - +#ifndef _LIBCPP_CXX03_LANG template <size_t _Ip, class _T1, class _T2> inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename tuple_element<_Ip, pair<_T1, _T2> >::type&& @@ -767,8 +761,7 @@ get(const pair<_T1, _T2>&& __p) _NOEXCEPT { return __get_pair<_Ip>::get(_VSTD::move(__p)); } - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG #if _LIBCPP_STD_VER > 11 template <class _T1, class _T2> @@ -906,7 +899,7 @@ inline constexpr in_place_t in_place{}; template <class _Tp> -struct _LIBCPP_TYPE_VIS in_place_type_t { +struct _LIBCPP_TEMPLATE_VIS in_place_type_t { explicit in_place_type_t() = default; }; template <class _Tp> diff --git a/include/valarray b/include/valarray index f0f1f62a1db8..f8e19acdb719 100644 --- a/include/valarray +++ b/include/valarray @@ -807,13 +807,11 @@ public: valarray(const value_type& __x, size_t __n); valarray(const value_type* __p, size_t __n); valarray(const valarray& __v); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY valarray(valarray&& __v) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS valarray(initializer_list<value_type> __il); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG valarray(const slice_array<value_type>& __sa); valarray(const gslice_array<value_type>& __ga); valarray(const mask_array<value_type>& __ma); @@ -823,14 +821,12 @@ public: // assignment: valarray& operator=(const valarray& __v); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY valarray& operator=(valarray&& __v) _NOEXCEPT; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS _LIBCPP_INLINE_VISIBILITY valarray& operator=(initializer_list<value_type>); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY valarray& operator=(const value_type& __x); _LIBCPP_INLINE_VISIBILITY @@ -861,32 +857,32 @@ public: __val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const; _LIBCPP_INLINE_VISIBILITY gslice_array<value_type> operator[](const gslice& __gs); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const; _LIBCPP_INLINE_VISIBILITY gslice_array<value_type> operator[](gslice&& __gs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const; _LIBCPP_INLINE_VISIBILITY mask_array<value_type> operator[](const valarray<bool>& __vb); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const; _LIBCPP_INLINE_VISIBILITY mask_array<value_type> operator[](valarray<bool>&& __vb); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const; _LIBCPP_INLINE_VISIBILITY indirect_array<value_type> operator[](const valarray<size_t>& __vs); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const; _LIBCPP_INLINE_VISIBILITY indirect_array<value_type> operator[](valarray<size_t>&& __vs); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG // unary operators: valarray operator+() const; @@ -1480,7 +1476,7 @@ public: __stride_(__stride) {__init(__start);} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY gslice(size_t __start, const valarray<size_t>& __size, @@ -1503,7 +1499,7 @@ public: __stride_(move(__stride)) {__init(__start);} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG // gslice(const gslice&) = default; // gslice(gslice&&) = default; @@ -1656,12 +1652,12 @@ private: __1d_(__gs.__1d_) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG gslice_array(gslice&& __gs, const valarray<value_type>& __v) : __vp_(const_cast<value_type*>(__v.__begin_)), __1d_(move(__gs.__1d_)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class> friend class valarray; }; @@ -2353,7 +2349,7 @@ private: __1d_(__ia) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v) @@ -2361,7 +2357,7 @@ private: __1d_(move(__ia)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class> friend class valarray; }; @@ -2572,7 +2568,7 @@ private: __1d_(__ia) {} -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY __indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e) @@ -2580,7 +2576,7 @@ private: __1d_(move(__ia)) {} -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG public: _LIBCPP_INLINE_VISIBILITY @@ -2814,7 +2810,7 @@ valarray<_Tp>::valarray(const valarray& __v) } } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -2825,10 +2821,6 @@ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT __v.__begin_ = __v.__end_ = nullptr; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Tp> valarray<_Tp>::valarray(initializer_list<value_type> __il) : __begin_(0), @@ -2855,7 +2847,7 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il) } } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _Tp> valarray<_Tp>::valarray(const slice_array<value_type>& __sa) @@ -2990,7 +2982,7 @@ valarray<_Tp>::operator=(const valarray& __v) return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3005,10 +2997,6 @@ valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT return *this; } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - template <class _Tp> inline valarray<_Tp>& @@ -3020,7 +3008,7 @@ valarray<_Tp>::operator=(initializer_list<value_type> __il) return *this; } -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#endif // _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3132,7 +3120,7 @@ valarray<_Tp>::operator[](const gslice& __gs) return gslice_array<value_type>(__gs, *this); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3150,7 +3138,7 @@ valarray<_Tp>::operator[](gslice&& __gs) return gslice_array<value_type>(move(__gs), *this); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3168,7 +3156,7 @@ valarray<_Tp>::operator[](const valarray<bool>& __vb) return mask_array<value_type>(__vb, *this); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3186,7 +3174,7 @@ valarray<_Tp>::operator[](valarray<bool>&& __vb) return mask_array<value_type>(move(__vb), *this); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3204,7 +3192,7 @@ valarray<_Tp>::operator[](const valarray<size_t>& __vs) return indirect_array<value_type>(__vs, *this); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_CXX03_LANG template <class _Tp> inline @@ -3222,7 +3210,7 @@ valarray<_Tp>::operator[](valarray<size_t>&& __vs) return indirect_array<value_type>(move(__vs), *this); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#endif // _LIBCPP_CXX03_LANG template <class _Tp> valarray<_Tp> diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8f1d57158028..15dc05c761c2 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -241,11 +241,16 @@ endif() if (LIBCXX_ENABLE_STATIC) add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>) target_link_libraries(cxx_static ${LIBCXX_LIBRARIES}) + set(STATIC_OUTPUT_NAME "c++") + if (WIN32) + set(STATIC_OUTPUT_NAME "libc++") + endif() set_target_properties(cxx_static PROPERTIES LINK_FLAGS "${LIBCXX_LINK_FLAGS}" - OUTPUT_NAME "c++" + OUTPUT_NAME "${STATIC_OUTPUT_NAME}" ) + list(APPEND LIBCXX_TARGETS "cxx_static") # Attempt to merge the libc++.a archive and the ABI library archive into one. if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) diff --git a/src/iostream.cpp b/src/iostream.cpp index a972be95499b..534b47a917d5 100644 --- a/src/iostream.cpp +++ b/src/iostream.cpp @@ -15,14 +15,14 @@ _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_HAS_NO_STDIN _ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?cin@__1@std@@3V?$basic_istream@DU?$char_traits@D@__1@std@@@12@A") #endif ; _ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin[sizeof(__stdinbuf <char>)]; static mbstate_t mb_cin; _ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcin@__1@std@@3V?$basic_istream@_WU?$char_traits@_W@__1@std@@@12@A") #endif ; @@ -32,14 +32,14 @@ static mbstate_t mb_wcin; #ifndef _LIBCPP_HAS_NO_STDOUT _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?cout@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A") #endif ; _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)]; static mbstate_t mb_cout; _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcout@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A") #endif ; @@ -48,14 +48,14 @@ static mbstate_t mb_wcout; #endif _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?cerr@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A") #endif ; _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)]; static mbstate_t mb_cerr; _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wcerr@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A") #endif ; @@ -63,12 +63,12 @@ _ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wcha static mbstate_t mb_wcerr; _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?clog@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A") #endif ; _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)] -#if defined(_MSC_VER) && defined(__clang__) +#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__) __asm__("?wclog@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A") #endif ; diff --git a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp index 43324e9418f9..30cf3f42e902 100644 --- a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp +++ b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp @@ -13,6 +13,7 @@ #include <vector> #include <cassert> +#include "test_macros.h" #include "asan_testing.h" class X { @@ -70,7 +71,7 @@ void test_push_back() { } void test_emplace_back() { -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 std::vector<X> v; v.reserve(2); v.push_back(X(2)); @@ -83,7 +84,7 @@ void test_emplace_back() { } assert(v.size() == 1); assert(is_contiguous_container_asan_correct(v)); -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif } void test_insert_range() { @@ -121,7 +122,7 @@ void test_insert() { } void test_emplace() { -#ifndef _LIBCPP_HAS_NO_VARIADICS +#if TEST_STD_VER >= 11 std::vector<X> v; v.reserve(3); v.insert(v.end(), X(1)); @@ -135,7 +136,7 @@ void test_emplace() { } assert(v.size() == 2); assert(is_contiguous_container_asan_correct(v)); -#endif // _LIBCPP_HAS_NO_VARIADICS +#endif } void test_insert_range2() { diff --git a/test/libcxx/iterators/trivial_iterators.pass.cpp b/test/libcxx/iterators/trivial_iterators.pass.cpp index d924a57ffeab..fa3ebf260486 100644 --- a/test/libcxx/iterators/trivial_iterators.pass.cpp +++ b/test/libcxx/iterators/trivial_iterators.pass.cpp @@ -179,7 +179,7 @@ int main() static_assert(( std::__libcpp_is_trivial_iterator<std::basic_string<char>::reverse_iterator> ::value), ""); static_assert(( std::__libcpp_is_trivial_iterator<std::basic_string<char>::const_reverse_iterator>::value), ""); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#if TEST_STD_VER >= 11 // Initializer list (which has no reverse iterators) static_assert(( std::__libcpp_is_trivial_iterator<std::initializer_list<char>::iterator> ::value), ""); static_assert(( std::__libcpp_is_trivial_iterator<std::initializer_list<char>::const_iterator> ::value), ""); diff --git a/test/libcxx/strings/iterators.exceptions.pass.cpp b/test/libcxx/strings/iterators.exceptions.pass.cpp index b236c5180b93..7dea53c4c3e9 100644 --- a/test/libcxx/strings/iterators.exceptions.pass.cpp +++ b/test/libcxx/strings/iterators.exceptions.pass.cpp @@ -80,7 +80,7 @@ int main() static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::reverse_iterator> ::value), ""); static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::const_reverse_iterator>::value), ""); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#if TEST_STD_VER >= 11 // Initializer list (which has no reverse iterators) static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::iterator> ::value), ""); static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::const_iterator> ::value), ""); diff --git a/test/libcxx/strings/iterators.noexcept.pass.cpp b/test/libcxx/strings/iterators.noexcept.pass.cpp index b8e0b4cdf34d..20b4e3d769e5 100644 --- a/test/libcxx/strings/iterators.noexcept.pass.cpp +++ b/test/libcxx/strings/iterators.noexcept.pass.cpp @@ -28,6 +28,7 @@ #include <vector> #include <initializer_list> +#include "test_macros.h" #include "test_iterators.h" int main() @@ -72,7 +73,7 @@ int main() static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::reverse_iterator> ::value), ""); static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::const_reverse_iterator>::value), ""); -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS +#if TEST_STD_VER >= 11 // Initializer list (which has no reverse iterators) static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::iterator> ::value), ""); static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::const_iterator> ::value), ""); diff --git a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp b/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp index 1c715e04970c..886884234b46 100644 --- a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp +++ b/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // type_traits // extension @@ -16,7 +18,6 @@ #include <type_traits> -#ifndef _LIBCPP_HAS_NO_CONSTEXPR struct A { @@ -54,11 +55,9 @@ struct J constexpr J* operator&() const &&; }; -#endif // _LIBCPP_HAS_NO_CONSTEXPR int main() { -#ifndef _LIBCPP_HAS_NO_CONSTEXPR static_assert(std::__has_operator_addressof<int>::value == false, ""); static_assert(std::__has_operator_addressof<A>::value == false, ""); static_assert(std::__has_operator_addressof<B>::value == true, ""); @@ -67,5 +66,4 @@ int main() static_assert(std::__has_operator_addressof<G>::value == true, ""); static_assert(std::__has_operator_addressof<H>::value == true, ""); static_assert(std::__has_operator_addressof<J>::value == true, ""); -#endif // _LIBCPP_HAS_NO_CONSTEXPR } 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 |