From 10089ce2027ac15fc04427189b3b22ccec4d8535 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 19 Nov 2019 13:54:12 -0800 Subject: [PATCH] scudo: Switch from std::random_shuffle to std::shuffle in a test. This lets the test build with C++17. Differential Revision: https://reviews.llvm.org/D70471 --- compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp index be620a6937c0..047a61653cb2 100644 --- a/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp @@ -14,6 +14,7 @@ #include #include +#include #include template static void testSecondaryBasic(void) { @@ -42,7 +43,7 @@ template static void testSecondaryBasic(void) { std::vector V; for (scudo::uptr I = 0; I < 32U; I++) V.push_back(L->allocate(Size)); - std::random_shuffle(V.begin(), V.end()); + std::shuffle(V.begin(), V.end(), std::mt19937(std::random_device()())); while (!V.empty()) { L->deallocate(V.back()); V.pop_back();