Skip to content

Commit 578d09c

Browse files
committedMay 11, 2021
[libcxx] deprecates/removes std::raw_storage_iterator
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
1 parent 9eb0969 commit 578d09c

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed
 

‎libcxx/include/__memory/raw_storage_iterator.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ _LIBCPP_PUSH_MACROS
2525

2626
_LIBCPP_BEGIN_NAMESPACE_STD
2727

28+
#if _LIBCPP_STD_VER <= 17
29+
2830
template <class _OutputIterator, class _Tp>
29-
class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
31+
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 raw_storage_iterator
3032
: public iterator<output_iterator_tag,
3133
_Tp, // purposefully not C++03
3234
ptrdiff_t, // purposefully not C++03
@@ -52,6 +54,8 @@ class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
5254
#endif
5355
};
5456

57+
#endif // _LIBCPP_STD_VER <= 17
58+
5559
_LIBCPP_END_NAMESPACE_STD
5660

5761
_LIBCPP_POP_MACROS
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// REQUIRES: c++17
10+
11+
// std::raw_storage_iterator
12+
13+
#include <memory>
14+
15+
std::raw_storage_iterator<int*, int> it(nullptr);
16+
// expected-warning@-1{{'raw_storage_iterator<int *, int>' is deprecated}}

‎libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.base.pass.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// REQUIRES: c++03 || c++11 || c++14 || c++17
10+
911
// raw_storage_iterator
1012

13+
#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1115
#include <memory>
1216
#include <type_traits>
1317
#include <cassert>

‎libcxx/test/std/utilities/memory/storage.iterator/raw_storage_iterator.pass.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// REQUIRES: c++03 || c++11 || c++14 || c++17
10+
911
// raw_storage_iterator
1012

13+
#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
14+
1115
#include <memory>
1216
#include <type_traits>
1317
#include <cassert>

0 commit comments

Comments
 (0)
Please sign in to comment.