Ensure std::generate_canonical doesn't return 1.
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Wed, 26 Aug 2015 21:27:09 +0000 (21:27 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 26 Aug 2015 21:27:09 +0000 (22:27 +0100)
commit33df19a736d340fed203de05071eaeb2110383d6
tree8eec2beadb20e9fa0350b2eb2acefcab3927bbf5
parent6bc41b268ea0e16e001f73a9760a9c847c6aa87c
Ensure std::generate_canonical doesn't return 1.

2015-08-26  Edward Smith-Rowland  <3dw4rd@verizon.net>
    Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/64351
PR libstdc++/63176
* include/bits/random.tcc (generate_canonical): Loop until we get a
result less than one.
* testsuite/26_numerics/random/uniform_real_distribution/operators/
64351.cc: New.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
From-SVN: r227233
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.tcc
libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/64351.cc [new file with mode: 0644]