diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -142,6 +142,10 @@ ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS``, this ensures that the members of ``allocator`` removed in C++20 can be accessed. +- ``std::function`` has been removed in C++03. If you are using it, please remove usages + or upgrade to C++11 or later. It is possible to re-enable ``std::function`` in C++03 by defining + ``_LIBCPP_ENABLE_CXX03_FUNCTION``. This option it will be removed in LLVM 16. + ABI Changes ----------- diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -1239,7 +1239,7 @@ swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT {return __x.swap(__y);} -#else // _LIBCPP_CXX03_LANG +#elif defined(_LIBCPP_ENABLE_CXX03_FUNCTION) namespace __function { @@ -2805,7 +2805,7 @@ swap(function<_Fp>& __x, function<_Fp>& __y) {return __x.swap(__y);} -#endif +#endif // _LIBCPP_CXX03_LANG _LIBCPP_END_NAMESPACE_STD