Index: include/memory =================================================================== --- include/memory +++ include/memory @@ -208,10 +208,10 @@ template ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); -template struct auto_ptr_ref {}; +template struct auto_ptr_ref {}; // removed in C++17 template -class auto_ptr +class auto_ptr // removed in C++17 { public: typedef X element_type; @@ -270,7 +270,7 @@ template unique_ptr(unique_ptr&& u) noexcept; template - unique_ptr(auto_ptr&& u) noexcept; + unique_ptr(auto_ptr&& u) noexcept; // removed in C++17 // destructor ~unique_ptr(); @@ -404,7 +404,7 @@ shared_ptr(shared_ptr&& r) noexcept; template shared_ptr(shared_ptr&& r) noexcept; template explicit shared_ptr(const weak_ptr& r); - template shared_ptr(auto_ptr&& r); + template shared_ptr(auto_ptr&& r); // removed in C++17 template shared_ptr(unique_ptr&& r); shared_ptr(nullptr_t) : shared_ptr() { } @@ -416,7 +416,7 @@ template shared_ptr& operator=(const shared_ptr& r) noexcept; shared_ptr& operator=(shared_ptr&& r) noexcept; template shared_ptr& operator=(shared_ptr&& r); - template shared_ptr& operator=(auto_ptr&& r); + template shared_ptr& operator=(auto_ptr&& r); // removed in C++17 template shared_ptr& operator=(unique_ptr&& r); // modifiers: @@ -1996,6 +1996,7 @@ inline _LIBCPP_INLINE_VISIBILITY void return_temporary_buffer(_Tp* __p) _NOEXCEPT {::operator delete(__p);} +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template struct auto_ptr_ref { @@ -2052,6 +2053,7 @@ public: typedef void element_type; }; +#endif template ::type, typename remove_cv<_T2>::type>::value, @@ -2496,6 +2498,7 @@ >::type = __nat()) _NOEXCEPT : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {} +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template _LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p, typename enable_if< @@ -2506,6 +2509,7 @@ : __ptr_(__p.release()) { } +#endif _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT { @@ -2557,6 +2561,7 @@ _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d) : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {} +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template _LIBCPP_INLINE_VISIBILITY typename enable_if< @@ -2566,7 +2571,7 @@ >::type operator=(auto_ptr<_Up> __p) {reset(__p.release()); return *this;} - +#endif #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();} @@ -3926,6 +3931,7 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template explicit shared_ptr(const weak_ptr<_Yp>& __r, typename enable_if::value, __nat>::type= __nat()); +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template shared_ptr(auto_ptr<_Yp>&& __r, @@ -3935,6 +3941,7 @@ shared_ptr(auto_ptr<_Yp> __r, typename enable_if::value, __nat>::type = __nat()); #endif +#endif #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template shared_ptr(unique_ptr<_Yp, _Dp>&&, @@ -3998,6 +4005,7 @@ >::type _LIBCPP_INLINE_VISIBILITY operator=(shared_ptr<_Yp>&& __r); +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template _LIBCPP_INLINE_VISIBILITY typename enable_if @@ -4007,7 +4015,9 @@ shared_ptr >::type& operator=(auto_ptr<_Yp>&& __r); +#endif #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template _LIBCPP_INLINE_VISIBILITY typename enable_if @@ -4018,6 +4028,7 @@ >::type operator=(auto_ptr<_Yp> __r); #endif +#endif template typename enable_if < @@ -4353,6 +4364,7 @@ #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template template #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -4368,6 +4380,7 @@ __enable_weak_this(__r.get(), __r.get()); __r.release(); } +#endif template template @@ -4674,6 +4687,7 @@ return *this; } +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template template inline @@ -4688,6 +4702,7 @@ shared_ptr(_VSTD::move(__r)).swap(*this); return *this; } +#endif template template @@ -4707,6 +4722,7 @@ #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) template template inline _LIBCPP_INLINE_VISIBILITY @@ -4721,6 +4737,7 @@ shared_ptr(__r).swap(*this); return *this; } +#endif template template Index: test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp =================================================================== --- test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp +++ test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template +// class auto_ptr; +// +// In C++17, auto_ptr has been removed. +// However, for backwards compatibility, if _LIBCPP_NO_REMOVE_AUTOPTR +// is defined before including , then auto_ptr will be restored. + +#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR + +#include +#include + +int main() +{ + std::auto_ptr p; +} Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/assignment.pass.cpp @@ -13,6 +13,8 @@ // auto_ptr& operator=(auto_ptr& a) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert.pass.cpp @@ -13,6 +13,8 @@ // auto_ptr(auto_ptr& a) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/convert_assignment.pass.cpp @@ -13,6 +13,8 @@ // template auto_ptr& operator=(auto_ptr& a) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/copy.pass.cpp @@ -13,6 +13,8 @@ // auto_ptr(auto_ptr& a) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.cons/pointer.pass.cpp @@ -13,6 +13,8 @@ // explicit auto_ptr(X* p =0) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/assign_from_auto_ptr_ref.pass.cpp @@ -13,6 +13,8 @@ // auto_ptr& operator=(auto_ptr_ref r) throw() +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_from_auto_ptr_ref.pass.cpp @@ -13,6 +13,8 @@ // auto_ptr(auto_ptr_ref r) throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr.pass.cpp @@ -13,6 +13,8 @@ // template operator auto_ptr() throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.conv/convert_to_auto_ptr_ref.pass.cpp @@ -13,6 +13,8 @@ // template operator auto_ptr_ref() throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/arrow.pass.cpp @@ -13,6 +13,8 @@ // X& operator*() const throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/deref.pass.cpp @@ -13,6 +13,8 @@ // X& operator*() const throw(); +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/release.pass.cpp @@ -16,6 +16,8 @@ #include #include +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include "../A.h" void Index: test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/auto.ptr.members/reset.pass.cpp @@ -16,6 +16,8 @@ #include #include +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include "../A.h" void Index: test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp =================================================================== --- test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp +++ test/std/depr/depr.auto.ptr/auto.ptr/element_type.pass.cpp @@ -17,6 +17,8 @@ // ... // }; +// REQUIRES-ANY: c++98, c++03, c++11, c++14 + #include #include Index: test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp =================================================================== --- test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp +++ test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp @@ -9,7 +9,7 @@ // libc++ cannot safely provide the auto_ptr constructor without rvalue // references. -// XFAIL: c++98, c++03 +// REQUIRES-ANY: c++11, c++14 // Index: test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp =================================================================== --- test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp +++ test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/auto_ptr_Y.pass.cpp @@ -10,6 +10,7 @@ // // shared_ptr +// REQUIRES-ANY: c++98, c++03 c++11, c++14 // template shared_ptr& operator=(auto_ptr&& r); Index: test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp =================================================================== --- test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp +++ test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp @@ -10,6 +10,7 @@ // // template explicit shared_ptr(auto_ptr&& r); +// REQUIRES-ANY: c++98, c++03 c++11, c++14 #include