mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-07 19:03:57 +00:00
[libc++] Remove std::function in C++03
We've said that we'll remove `std::function` from C++03 in LLVM 16, so we might as well do it now before we forget. Reviewed By: ldionne, #libc, Mordante Spies: jloser, Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D135868
This commit is contained in:
parent
a398981fb0
commit
dbe60caa92
@ -87,6 +87,9 @@ Deprecations and Removals
|
||||
the C++23 paper that makes these functions ``constexpr``, therefore the
|
||||
extension has been removed.
|
||||
|
||||
- The ``_LIBCPP_ENABLE_CXX03_FUNCTION`` macro that allowed re-enabling the now-deprecated C++03 implementation of
|
||||
``std::function`` has been removed. Users who need to use ``std::function`` should switch to C++11 and above.
|
||||
|
||||
Upcoming Deprecations and Removals
|
||||
----------------------------------
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
|
||||
// Check that libc++'s emulation of std::function is deprecated in C++03
|
||||
|
||||
// REQUIRES: c++03
|
||||
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include "test_macros.h"
|
||||
|
||||
int main(int, char**) {
|
||||
// Note:
|
||||
// We use sizeof() to require it to be a complete type. We don't create a
|
||||
// variable because otherwise we get two warnings for each variable (the
|
||||
// second warning is when the destructor is implicitly called).
|
||||
(void)sizeof(std::function<void ()>); // expected-warning {{'function<void ()>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int)>); // expected-warning {{'function<void (int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int)>); // expected-warning {{'function<void (int, int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int, int)>); // expected-warning {{'function<void (int, int, int)>' is deprecated}}
|
||||
return 0;
|
||||
}
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function& operator=(function &&);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function& operator=(nullptr_t);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
// <streambuf>
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// template <class charT, class traits = char_traits<charT> >
|
||||
// class basic_streambuf;
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// Class bad_function_call
|
||||
|
||||
// class bad_function_call
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// Class bad_function_call
|
||||
|
||||
// bad_function_call();
|
||||
|
@ -6,13 +6,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
// Make sure we can use std::function with a type that has a hostile overload
|
||||
// of operator&().
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -13,9 +15,6 @@
|
||||
// template <MoveConstructible R, MoveConstructible ... ArgTypes>
|
||||
// void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept;
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// explicit operator bool() const
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
#include <type_traits>
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function(F);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -15,9 +17,6 @@
|
||||
// && Convertible<Callable<F, ArgTypes...>::result_type
|
||||
// operator=(F f);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -14,9 +16,6 @@
|
||||
|
||||
// Allow incomplete argument types in the __is_callable check
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -15,9 +17,6 @@
|
||||
// Ensure that __not_null works for all function types.
|
||||
// See https://llvm.org/PR23589
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// TESTING std::function<...>::__not_null(Callable)
|
||||
//
|
||||
|
@ -7,7 +7,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
// REQUIRES: c++03 || c++11 || c++14
|
||||
// REQUIRES: c++11 || c++14
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
@ -15,9 +15,6 @@
|
||||
//
|
||||
// This signature was removed in C++17
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -7,15 +7,12 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
// REQUIRES: c++03 || c++11 || c++14
|
||||
// REQUIRES: c++11 || c++14
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// template<class F, class A> function(allocator_arg_t, const A&, F);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -7,15 +7,12 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
// REQUIRES: c++03 || c++11 || c++14
|
||||
// REQUIRES: c++11 || c++14
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// template<class A> function(allocator_arg_t, const A&, const function&);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <functional>
|
||||
// REQUIRES: c++03 || c++11 || c++14
|
||||
// REQUIRES: c++11 || c++14
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
@ -15,9 +15,6 @@
|
||||
//
|
||||
// This signature was removed in C++17
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function& operator=(const function& f);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <cassert>
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
@ -10,6 +10,8 @@
|
||||
// allocations.
|
||||
// XFAIL: target=x86_64-pc-windows-msvc && stdlib=libc++
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -17,9 +19,6 @@
|
||||
// function(const function& f);
|
||||
// function(function&& f); // noexcept in C++20
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <cstdlib>
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function();
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function(nullptr_t);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// function& operator=(nullptr_t);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -13,9 +15,6 @@
|
||||
// template<class F, class A> void assign(F&&, const A&);
|
||||
// This call was removed post-C++14
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// void swap(function& other);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -22,9 +24,6 @@
|
||||
// template <MoveConstructible R, MoveConstructible ... ArgTypes>
|
||||
// bool operator!=(nullptr_t, const function<R(ArgTypes...)>&);
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
@ -19,9 +21,6 @@
|
||||
// const T*
|
||||
// target() const;
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
// UNSUPPORTED: no-rtti
|
||||
|
||||
#include <functional>
|
||||
|
@ -6,15 +6,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// class function<R(ArgTypes...)>
|
||||
|
||||
// const std::type_info& target_type() const;
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
// UNSUPPORTED: no-rtti
|
||||
|
||||
#include <functional>
|
||||
|
@ -6,6 +6,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// template<Returnable R, CopyConstructible... ArgTypes>
|
||||
@ -21,9 +23,6 @@
|
||||
// ...
|
||||
// };
|
||||
|
||||
// This test runs in C++03, but we have deprecated using std::function in C++03.
|
||||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user