aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libstdc++-v3
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2014-08-06 17:50:42 -0700
committerRong Xu <xur@google.com>2014-08-06 17:50:42 -0700
commitf1c18afafc2b321465ae6b07ede127095942d7dc (patch)
tree812093eebfa8510367718c12c02f7da03c0e73bf /gcc-4.9/libstdc++-v3
parent38a8aecfb882072900434499696b5c32a2274515 (diff)
downloadtoolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.tar.gz
toolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.tar.bz2
toolchain_gcc-f1c18afafc2b321465ae6b07ede127095942d7dc.zip
[gcc-4.9] Merge svn r213650 from google/gcc-4_9 branch
Merge svn r213650 from google/gcc-4_9 branch. Tested with arm,x86,mips,arm64,x86_64,mips64 build in liunux/windows. Change-Id: I0c07f67d516074172aa393003eee664d01f2e0f2
Diffstat (limited to 'gcc-4.9/libstdc++-v3')
-rw-r--r--gcc-4.9/libstdc++-v3/ChangeLog15
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/random.h2
-rw-r--r--gcc-4.9/libstdc++-v3/include/bits/random.tcc3
-rw-r--r--gcc-4.9/libstdc++-v3/include/ext/random.tcc2
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc-4.9/libstdc++-v3/ChangeLog b/gcc-4.9/libstdc++-v3/ChangeLog
index 7662fa12f..09b7017cd 100644
--- a/gcc-4.9/libstdc++-v3/ChangeLog
+++ b/gcc-4.9/libstdc++-v3/ChangeLog
@@ -1,3 +1,18 @@
+2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
+
+ PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>
+ * include/bits/random.h (_Adaptor): static_assert for non floating-point
+ result type.
+ * include/bits/random.tcc (generate_canonical): Ditto.
+ * include/ext/random.tcc (hypergeometric_distribution::operator()):
+ Use double as a rng result type.
+ * testsuite/26_numerics/random/pr60037-neg.cc: New.
+ * testsuite/ext/random/hypergeometric_distribution/pr60037.cc: New.
+
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
2014-06-23 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/61532
diff --git a/gcc-4.9/libstdc++-v3/include/bits/random.h b/gcc-4.9/libstdc++-v3/include/bits/random.h
index edfd797b7..b34dbe659 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/random.h
+++ b/gcc-4.9/libstdc++-v3/include/bits/random.h
@@ -164,6 +164,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
template<typename _Engine, typename _DInputType>
struct _Adaptor
{
+ static_assert(std::is_floating_point<_DInputType>::value,
+ "template argument not a floating point type");
public:
_Adaptor(_Engine& __g)
diff --git a/gcc-4.9/libstdc++-v3/include/bits/random.tcc b/gcc-4.9/libstdc++-v3/include/bits/random.tcc
index 0eda287f4..8849ee90d 100644
--- a/gcc-4.9/libstdc++-v3/include/bits/random.tcc
+++ b/gcc-4.9/libstdc++-v3/include/bits/random.tcc
@@ -3463,6 +3463,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RealType
generate_canonical(_UniformRandomNumberGenerator& __urng)
{
+ static_assert(std::is_floating_point<_RealType>::value,
+ "template argument not a floating point type");
+
const size_t __b
= std::min(static_cast<size_t>(std::numeric_limits<_RealType>::digits),
__bits);
diff --git a/gcc-4.9/libstdc++-v3/include/ext/random.tcc b/gcc-4.9/libstdc++-v3/include/ext/random.tcc
index dd7a14a42..fec7f862b 100644
--- a/gcc-4.9/libstdc++-v3/include/ext/random.tcc
+++ b/gcc-4.9/libstdc++-v3/include/ext/random.tcc
@@ -1314,7 +1314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_UniformRandomNumberGenerator& __urng,
const param_type& __param)
{
- std::__detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
+ std::__detail::_Adaptor<_UniformRandomNumberGenerator, double>
__aurng(__urng);
result_type __a = __param.successful_size();