On Mar 24, 2021, Jonathan Wakely <jwak...@redhat.com> wrote: > diff --git a/libstdc++-v3/testsuite/util/testsuite_random.h > b/libstdc++-v3/testsuite/util/testsuite_random.h > index 0b670bfb771..c8323078492 100644 > --- a/libstdc++-v3/testsuite/util/testsuite_random.h > +++ b/libstdc++-v3/testsuite/util/testsuite_random.h > @@ -197,6 +197,19 @@ namespace __gnu_test > } > #endif > + // Check whether TOKEN can construct a std::random_device successfully. > + inline bool > + random_device_available(const std::string& token) noexcept > + { > + try { > + std::random_device dev(token); > + return true; > + } catch (...) { > + std::printf("random_device(\"%s\") not available\n", token);
Another nit: I'm seeing line noise (do people still use this term? :-) in libstdc++.log where unavailable random_device tokens should appear. I suspect the token has to be converted to a C string in the call above. -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Vim, Vi, Voltei pro Emacs -- GNUlius Caesar