Remove auto_ptr in C++17. Get it back by defining _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292986 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <memory>
|
||||
|
||||
// template <class X>
|
||||
// class auto_ptr;
|
||||
//
|
||||
// In C++17, auto_ptr has been removed.
|
||||
// However, for backwards compatibility, if _LIBCPP_NO_REMOVE_AUTOPTR
|
||||
// is defined before including <memory>, then auto_ptr will be restored.
|
||||
|
||||
#define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
|
||||
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::auto_ptr<int> p;
|
||||
}
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// auto_ptr& operator=(auto_ptr& a) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// auto_ptr(auto_ptr& a) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// template<class Y> auto_ptr& operator=(auto_ptr<Y>& a) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// auto_ptr(auto_ptr& a) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// explicit auto_ptr(X* p =0) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// auto_ptr& operator=(auto_ptr_ref<X> r) throw()
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// auto_ptr(auto_ptr_ref<X> r) throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// template<class Y> operator auto_ptr<Y>() throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// template<class Y> operator auto_ptr_ref<Y>() throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// X& operator*() const throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
// X& operator*() const throw();
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include "../A.h"
|
||||
|
||||
void
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include "../A.h"
|
||||
|
||||
void
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
// ...
|
||||
// };
|
||||
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
// <memory>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
// <memory>
|
||||
|
||||
// shared_ptr
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
// template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
// <memory>
|
||||
|
||||
// template<class Y> explicit shared_ptr(auto_ptr<Y>&& r);
|
||||
// REQUIRES-ANY: c++98, c++03, c++11, c++14
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
Reference in New Issue
Block a user