From: Jonathan Wakely Date: Tue, 16 Oct 2018 22:42:39 +0000 (+0100) Subject: Fix regression in std::random_device default constructor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec2e0ad5ea14eba33a120ce38b2ae25b3c7b7996;p=gcc.git Fix regression in std::random_device default constructor When the default constructor was split out into a separate function (in r261522) I accidentally made it call _M_init("mt19937") instead of _M_init_pretr1("mt19937"). That means it will always throw an exception, because "mt19937" isn't a valid token accepted by the _M_init function. Restore the original behaviour by calling _M_init_pretr1("mt19937"). * include/bits/random.h (random_device) [!_GLIBCXX_USE_DEV_RANDOM]: Fix default constructor to call correct function. From-SVN: r265218 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index bfc9f73213c..57a35f0faad 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2018-10-16 Jonathan Wakely + * include/bits/random.h (random_device) [!_GLIBCXX_USE_DEV_RANDOM]: + Fix default constructor to call correct function. + * testsuite/experimental/net/internet/address/v4/creation.cc: Do not declare ip in global namespace, to avoid collision with struct ip defined in . diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index 5e994aa8836..e02a185e3f0 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -1611,7 +1611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ~random_device() { _M_fini(); } #else - random_device() { _M_init("mt19937"); } + random_device() { _M_init_pretr1("mt19937"); } explicit random_device(const std::string& __token)