[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
Mon May 10 15:18:29 PDT 2021


cjdb updated this revision to Diff 344216.
cjdb marked 4 inline comments as done.
cjdb added a comment.

applies all of @Quuxplusone's 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 @@
 //
 //===----------------------------------------------------------------------===//
 
+// REQUIRES: c++03 || c++11 || c++14 || c++17
+
 // 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,8 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+// REQUIRES: c++03 || c++11 || c++14 || c++17
+
 // raw_storage_iterator
 
+#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+
 #include <memory>
 #include <type_traits>
 #include <cassert>
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,16 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 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.344216.patch
Type: text/x-patch
Size: 2903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210510/77953b59/attachment.bin>


More information about the libcxx-commits mailing list