https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125548
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <[email protected]>: https://gcc.gnu.org/g:2cb78d1a0e5bd0d831690296df0bc35128ae009c commit r17-4535-g2cb78d1a0e5bd0d831690296df0bc35128ae009c Author: Tomasz KamiÅski <[email protected]> Date: Wed Sep 9 09:55:18 2026 +0200 libstdc++: Merge piecewise distributions configuration defines. [PR82749,PR125548] This patch introduces _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS that replaces a separate _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS (value 0) and _GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES (value 2). This better reflects their behavior, as they were not orthogonal previously as defining _GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES hand no effect if _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS was defined. libstdc++-v3/ChangeLog: PR libstdc++/82749 PR libstdc++/125548 * doc/xml/manual/using.xml (_GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS) (_GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES): Replace with... (_GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS): Add entry. * doc/html/manual/using_macros.html: Regenrate. * include/bits/c++config (_GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS) [__cplusplus >= 201103L]: Define to the value 1 if not already defined. * include/bits/random.h (__detail::__piecewise_distributions_storage) (__detail::__piecewise_distributions_storage_t): Adjust to depend on _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS value. (piecewise_constant_distribution::_CalcType) (piecewise_linear_distribution::_CalcType) (piecewise_constant_distribution::param_type::densities) (piecewise_linear_distribution::param_type::densities): Check for non-zero value of _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS instead of defintion of _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS and reorder branches. * include/bits/random.tcc (piecewise_constant_distribution::param_type::param_type) (piecewise_constant_distribution::param_type::param_type): Likewise. * testsuite/26_numerics/random/piecewise_constant_distribution/operators/accessors.cc: Replace checks for _GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS _GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES defintions with checks of _GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS values. * testsuite/26_numerics/random/piecewise_linear_distribution/operators/accessors.cc: Likewise. * testsuite/26_numerics/random/piecewise_linear_distribution/cons/pr125548.cc: Likewise. * testsuite/26_numerics/random/piecewise_constant_distribution/operators/accessors_fallback.cc: Replace -D_GLIBCXX_USE_OLD_PIECEWISE_DISTRIBUTIONS with -D_GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS=0. * testsuite/26_numerics/random/piecewise_linear_distribution/operators/accessors_fallback.cc: Likewise. * testsuite/26_numerics/random/piecewise_linear_distribution/cons/pr125548_fallback.cc: Likewise. * testsuite/26_numerics/random/piecewise_constant_distribution/cons/input_type_fallback_neg.cc: Likewise. * testsuite/26_numerics/random/piecewise_linear_distribution/cons/input_type_fallback_neg.cc: Likewise. * testsuite/26_numerics/random/piecewise_constant_distribution/operators/accessors_exact.cc: Replace -D_GLIBCXX_USE_RESULT_TYPE_FOR_PIECEWISE_DENSITIES with -D_GLIBCXX_USE_NEW_PIECEWISE_DISTRIBUTIONS=2. * testsuite/26_numerics/random/piecewise_linear_distribution/operators/accessors_exact.cc: Likewise. Reviewed-by: Jonathan Wakely <[email protected]>
