From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: by sourceware.org (Postfix, from userid 2181)
id 0B85F3889C2A; Tue, 3 Aug 2021 15:33:57 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B85F3889C2A
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="utf-8"
From: Jonathan Wakely
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-2700] libstdc++: Deprecate std::random_shuffle for C++14
X-Act-Checkin: gcc
X-Git-Author: Jonathan Wakely
X-Git-Refname: refs/heads/master
X-Git-Oldrev: 07b70dfc4eab7869e7a43b3ff5b8b512dba0bb6e
X-Git-Newrev: 7f2f4b87910506effb8dffffc60eeb2451573126
Message-Id: <20210803153357.0B85F3889C2A@sourceware.org>
Date: Tue, 3 Aug 2021 15:33:57 +0000 (GMT)
X-BeenThere: gcc-cvs@gcc.gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Gcc-cvs mailing list
List-Unsubscribe: ,
List-Archive:
List-Help:
List-Subscribe: ,
X-List-Received-Date: Tue, 03 Aug 2021 15:33:57 -0000
https://gcc.gnu.org/g:7f2f4b87910506effb8dffffc60eeb2451573126
commit r12-2700-g7f2f4b87910506effb8dffffc60eeb2451573126
Author: Jonathan Wakely
Date: Mon Aug 2 18:35:42 2021 +0100
libstdc++: Deprecate std::random_shuffle for C++14
The std::random_shuffle algorithm was removed in C++14 (without
deprecation). This adds the deprecated attribute for C++14 and later, so
that users are warned they should not be using it in those dialects.
Signed-off-by: Jonathan Wakely
libstdc++-v3/ChangeLog:
* doc/xml/manual/evolution.xml: Document deprecation.
* doc/html/*: Regenerate.
* include/bits/c++config (_GLIBCXX14_DEPRECATED): Define.
(_GLIBCXX14_DEPRECATED_SUGGEST): Define.
* include/bits/stl_algo.h (random_shuffle): Deprecate for C++14
and later.
* testsuite/25_algorithms/headers/algorithm/synopsis.cc: Adjust
for C++11 and C++14 changes to std::random_shuffle and
std::shuffle.
* testsuite/25_algorithms/random_shuffle/1.cc: Add options to
use deprecated algorithms.
* testsuite/25_algorithms/random_shuffle/59603.cc: Likewise.
* testsuite/25_algorithms/random_shuffle/moveable.cc: Likewise.
* testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc:
Likewise.
* testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc:
Likewise.
Diff:
---
libstdc++-v3/doc/html/index.html | 2 +-
libstdc++-v3/doc/html/manual/api.html | 4 ++++
libstdc++-v3/doc/html/manual/appendix.html | 2 +-
libstdc++-v3/doc/html/manual/appendix_porting.html | 2 +-
libstdc++-v3/doc/html/manual/index.html | 2 +-
libstdc++-v3/doc/xml/manual/evolution.xml | 10 ++++++++++
libstdc++-v3/include/bits/c++config | 10 ++++++++++
libstdc++-v3/include/bits/stl_algo.h | 10 ++++++++--
.../testsuite/25_algorithms/headers/algorithm/synopsis.cc | 8 ++++++++
libstdc++-v3/testsuite/25_algorithms/random_shuffle/1.cc | 2 ++
libstdc++-v3/testsuite/25_algorithms/random_shuffle/59603.cc | 1 +
.../testsuite/25_algorithms/random_shuffle/moveable.cc | 1 +
.../random_shuffle/requirements/explicit_instantiation/2.cc | 1 +
.../random_shuffle/requirements/explicit_instantiation/pod.cc | 1 +
14 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html
index ed1a05f36f7..d21efe58a58 100644
--- a/libstdc++-v3/doc/html/index.html
+++ b/libstdc++-v3/doc/html/index.html
@@ -142,7 +142,7 @@
Existing tests
C++11 Requirements Test Sequence Descriptions
-ABI Policy and Guidelines- The C++ Interface
- Versioning
- Goals
- History
- Prerequisites
- Configuring
- Checking Active
- Allowed Changes
- Prohibited Changes
- Implementation
- Testing
- Single ABI Testing
- Multiple ABI Testing
- Outstanding Issues
API Evolution and Deprecation History3.0
3.1
3.2
3.3
3.4
4.0
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
5
5.3
6
7
7.2
7.3
8
9
10
11
Backwards Compatibility- First
- Second
- Third
- Pre-ISO headers removed
- Extension headers hash_map, hash_set moved to ext or backwards
- No
ios::nocreate/ios::noreplace
.
+
ABI Policy and Guidelines- The C++ Interface
- Versioning
- Goals
- History
- Prerequisites
- Configuring
- Checking Active
- Allowed Changes
- Prohibited Changes
- Implementation
- Testing
- Single ABI Testing
- Multiple ABI Testing
- Outstanding Issues
API Evolution and Deprecation History3.0
3.1
3.2
3.3
3.4
4.0
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
5
5.3
6
7
7.2
7.3
8
9
10
11
12
Backwards Compatibility- First
- Second
- Third
- Pre-ISO headers removed
- Extension headers hash_map, hash_set moved to ext or backwards
- No
ios::nocreate/ios::noreplace
.
-
No
stream::attach(int fd)
-
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index 70889a583f9..376a4035fa6 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -436,4 +436,8 @@ now defaults to zero.
Calling
reserve()
with no arguments is equivalent
to shrink_to_fit()
, but is deprecated.
shrink_to_fit()
should be used instead.
+
+The std::random_shuffle
algorithms are deprecated
+for C++14 and later. The C++11 std::shuffle
algorithm
+can be used instead.