[libcxx-commits] [PATCH] D101730: [libcxx] deprecates/removes `std::raw_storage_iterator`
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 2 17:37:06 PDT 2021
cjdb updated this revision to Diff 342295.
cjdb marked 2 inline comments as done.
cjdb added a comment.
applies @quuxplusone feedback
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101730/new/
https://reviews.llvm.org/D101730
Files:
libcxx/include/__memory/raw_storage_iterator.h
libcxx/test/std/utilities/memory/storage.iterator/deprecated.verify.cpp
libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp
libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
Index: libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
===================================================================
--- libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
+++ libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp
@@ -6,8 +6,12 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++20, c++2b
+
// raw_storage_iterator
+#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
#include <memory>
#include <type_traits>
#include <cassert>
Index: libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp
===================================================================
--- libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp
+++ libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++20, c++2b
+
// raw_storage_iterator
#include <memory>
@@ -14,6 +16,8 @@
#include "test_macros.h"
+#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
#if TEST_STD_VER >= 11
#define DELETE_FUNCTION = delete
#else
Index: libcxx/test/std/utilities/memory/storage.iterator/deprecated.verify.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/utilities/memory/storage.iterator/deprecated.verify.cpp
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+#include "test_macros.h"
+
+std::raw_storage_iterator<int*, int> it(nullptr);
+// expected-warning at -1{{'raw_storage_iterator<int *, int>' is deprecated}}
Index: libcxx/include/__memory/raw_storage_iterator.h
===================================================================
--- libcxx/include/__memory/raw_storage_iterator.h
+++ libcxx/include/__memory/raw_storage_iterator.h
@@ -25,8 +25,10 @@
_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
@@ -52,6 +54,8 @@
#endif
};
+#endif // _LIBCPP_STD_VER <= 17
+
_LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101730.342295.patch
Type: text/x-patch
Size: 2965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210503/a9d148ee/attachment-0001.bin>
More information about the libcxx-commits
mailing list