This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/60037] SIGFPE in std::generate_canonical<unsigned int...>
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 27 Jul 2014 14:58:31 +0000
- Subject: [Bug libstdc++/60037] SIGFPE in std::generate_canonical<unsigned int...>
- Auto-submitted: auto-generated
- References: <bug-60037-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60037
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |3dw4rd at verizon dot net
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
To further clarify, the problem is that hypergeometric_distribution is using:
std::__detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
__aurng(__urng);
where result_type is an *integer* type, and that is not Ok, because _Adaptor
just forwards to generate_canonical, which wants a *floting point* type as
first template argument. I suspect that something as simple as:
std::__detail::_Adaptor<_UniformRandomNumberGenerator, double>
__aurng(__urng);
could be most of the fix (in a couple other places, for discrete distributions,
I ended up using _Adaptor exactly like that) but the implementor (ie, Ed) of
hypergeometric_distribution should really look into it.
Eventually, we should remember to add a static_assert to _Adaptor of the form:
static_assert(std::is_floating_point<_DInputType>::value,
"template argument not a floating point type");
Ed, can you please have a look?