]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add deprecated attribute to std::random_shuffle declarations
authorJonathan Wakely <jwakely@redhat.com>
Wed, 26 Jul 2023 13:05:58 +0000 (14:05 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 26 Jul 2023 16:02:46 +0000 (17:02 +0100)
commitc01b344e814001e07fd304ce98d013d811e90192
tree9168fd0d7d64763cdc7236fd7beb224b056a5ea6
parentd74aed3d7aefbb661ae629a91ca7baa4916085f0
libstdc++: Add deprecated attribute to std::random_shuffle declarations

We already have these attributes on the definitions in <bits/stl_algo.h>
but they don't work due to PR c++/84542. Add the attributes to the
declarations in <bits/algorithmfwd.h> as well, and add a test.

libstdc++-v3/ChangeLog:

* include/bits/algorithmfwd.h (random_shuffle): Add deprecated
attribute.
* include/bits/stl_algo.h (random_shuffle): Correct comments.
* testsuite/25_algorithms/random_shuffle/1.cc: Disable
deprecated warnings.
* testsuite/25_algorithms/random_shuffle/59603.cc: Likewise.
* testsuite/25_algorithms/random_shuffle/moveable.cc: Likewise.
* testsuite/25_algorithms/random_shuffle/deprecated.cc: New
test.
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/testsuite/25_algorithms/random_shuffle/1.cc
libstdc++-v3/testsuite/25_algorithms/random_shuffle/59603.cc
libstdc++-v3/testsuite/25_algorithms/random_shuffle/deprecated.cc [new file with mode: 0644]
libstdc++-v3/testsuite/25_algorithms/random_shuffle/moveable.cc