https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82584

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:56b810af1bdf106b132dcf1f1a01573af6a3468b

commit r10-9572-g56b810af1bdf106b132dcf1f1a01573af6a3468b
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Oct 8 15:14:58 2020 +0100

    libstdc++: Add assertions for preconditions in sampling distributions [PR
82584]

    These three distributions all require 0 < S where S is the sum of the
    weights. When the sum is zero there's an undefined FP division by zero.
    Add assertions to help users diagnose the problem.

    libstdc++-v3/ChangeLog:

            PR libstdc++/82584
            * include/bits/random.tcc
            (discrete_distribution::param_type::_M_initialize)
            (piecewise_constant_distribution::param_type::_M_initialize)
            (piecewise_linear_distribution::param_type::_M_initialize):
            Add assertions for positive sums..
            * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
            line.

    (cherry picked from commit b2a96bf9dce41ee777b1669e4a8b4c6df3ff3613)
  • [Bug libstdc++/82584] div by ze... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to