C++17 deprecates `std::raw_storage_iterator` and C++20 removes it.
Implements part of:
* P0174R2 'Deprecating Vestigial Library Parts in C++17'
* P0619R4 'Reviewing Deprecated Facilities of C++17 for C++20'
Differential Revision: https://reviews.llvm.org/D101730
_LIBCPP_BEGIN_NAMESPACE_STD
+#if _LIBCPP_STD_VER <= 17
+
template <class _OutputIterator, class _Tp>
-class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
: public iterator<output_iterator_tag,
_Tp, // purposefully not C++03
ptrdiff_t, // purposefully not C++03
#endif
};
+#endif // _LIBCPP_STD_VER <= 17
+
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
--- /dev/null
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: c++17
+
+// std::raw_storage_iterator
+
+#include <memory>
+
+std::raw_storage_iterator<int*, int> it(nullptr);
+// expected-warning@-1{{'raw_storage_iterator<int *, int>' is deprecated}}
//
//===----------------------------------------------------------------------===//
+// REQUIRES: c++03 || c++11 || c++14 || c++17
+
// raw_storage_iterator
+#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
#include <memory>
#include <type_traits>
#include <cassert>
//
//===----------------------------------------------------------------------===//
+// REQUIRES: c++03 || c++11 || c++14 || c++17
+
// raw_storage_iterator
+#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
#include <memory>
#include <type_traits>
#include <cassert>