diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2015-08-24 14:43:36 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-08-24 14:43:36 +0100 |
commit | 3af7efb7d966228f55664175c029d02d21b69873 (patch) | |
tree | d21776dc671e092e67b7ecb887c860602c390150 | |
parent | 8e87588a594a6ed6785b7da342a82a63497d4556 (diff) | |
download | gcc-3af7efb7d966228f55664175c029d02d21b69873.zip gcc-3af7efb7d966228f55664175c029d02d21b69873.tar.gz gcc-3af7efb7d966228f55664175c029d02d21b69873.tar.bz2 |
re PR libstdc++/67309 (Error compiling with -std=c++11 and -fsingle-precision-constant)
PR libstdc++/67309
* include/bits/random.tcc
(poisson_distribution::param_type::_M_initialize): Use max<double>.
(binomial_distribution::param_type::_M_initialize): Likewise.
* testsuite/17_intro/headers/c++200x/67309.cc: New.
* testsuite/17_intro/headers/c++200x/all_attributes.cc: Remove
redundant header.
From-SVN: r227126
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/random.tcc | 6 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc | 23 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc | 1 |
4 files changed, 36 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8f78594..090e8e3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2015-08-24 Jonathan Wakely <jwakely@redhat.com> + + PR libstdc++/67309 + * include/bits/random.tcc + (poisson_distribution::param_type::_M_initialize): Use max<double>. + (binomial_distribution::param_type::_M_initialize): Likewise. + * testsuite/17_intro/headers/c++200x/67309.cc: New. + * testsuite/17_intro/headers/c++200x/all_attributes.cc: Remove + redundant header. + 2015-08-20 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/67294 diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index f10d052..4fdbcfc 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -1405,7 +1405,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const double __pi_4 = 0.7853981633974483096156608458198757L; const double __dx = std::sqrt(2 * __m * std::log(32 * __m / __pi_4)); - _M_d = std::round(std::max(6.0, std::min(__m, __dx))); + _M_d = std::round(std::max<double>(6.0, std::min(__m, __dx))); const double __cx = 2 * __m + _M_d; _M_scx = std::sqrt(__cx / 2); _M_1cx = 1 / __cx; @@ -1613,11 +1613,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const double __d1x = std::sqrt(__np * __1p * std::log(32 * __np / (81 * __pi_4 * __1p))); - _M_d1 = std::round(std::max(1.0, __d1x)); + _M_d1 = std::round(std::max<double>(1.0, __d1x)); const double __d2x = std::sqrt(__np * __1p * std::log(32 * _M_t * __1p / (__pi_4 * __pa))); - _M_d2 = std::round(std::max(1.0, __d2x)); + _M_d2 = std::round(std::max<double>(1.0, __d2x)); // sqrt(pi / 2) const double __spi_2 = 1.2533141373155002512078826424055226L; diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc new file mode 100644 index 0000000..97df10f --- /dev/null +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/67309.cc @@ -0,0 +1,23 @@ +// Copyright (C) 2015 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +// { dg-options "-std=gnu++11 -fsingle-precision-constant" } +// { dg-do compile } + +// libstdc++/67309 +#include <bits/stdc++.h> // TODO: this is missing from <bits/extc++.h> +#include <bits/extc++.h> diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc index 8d93fd9..ae15f31 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/all_attributes.cc @@ -35,7 +35,6 @@ #endif #include <bits/stdc++.h> // TODO: this is missing from <bits/extc++.h> -#include <codecvt> // TODO: this is missing from <bits/stdc++.h> #include <bits/extc++.h> int |